Upd:部分查询数据接口查询数据源改为只读数据源

master
duLingLing 5 years ago
parent 792dfe944f
commit b7631d79fa

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.1.5</version>
<version>1.1.6</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean;
import au.com.royalpay.payment.manage.analysis.core.AmountAnalysisService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import com.alibaba.fastjson.JSONObject;
@ -25,6 +26,7 @@ public class AmountAnalysisController {
private AmountAnalysisService amountAnalysisService;
@ManagerMapping("")
@ReadOnlyConnection
public List<JSONObject> getAmountList(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
if (manager.getIntValue("org_id") > 0) {
throw new ForbiddenException("You have no permission");
@ -34,6 +36,7 @@ public class AmountAnalysisController {
}
@ManagerMapping("/orders")
@ReadOnlyConnection
public JSONObject getRangeOrders(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
if (manager.getIntValue("org_id") > 0) {
throw new ForbiddenException("You have no permission");

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.manage.analysis.beans.AreaMerchantTradeQueryBean;
import au.com.royalpay.payment.manage.analysis.core.AreaMerchantTradeAnalysis;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject;
@ -25,11 +26,13 @@ public class AreaMerchantTradeController {
private AreaMerchantTradeAnalysis areaMerchantTradeAnalysis;
@ManagerMapping(value = "",method = RequestMethod.GET,role = ManagerRole.ADMIN)
@ReadOnlyConnection
public JSONObject listClientAmount(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,AreaMerchantTradeQueryBean queryBean){
return areaMerchantTradeAnalysis.listAreaMerchantTrade(manager,queryBean);
}
@ManagerMapping(value = "/excel",method = RequestMethod.GET,role = ManagerRole.ADMIN)
@ReadOnlyConnection
public void exportExcel(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,AreaMerchantTradeQueryBean queryBean,HttpServletResponse httpResponse)throws Exception{
areaMerchantTradeAnalysis.importTradeExcel(manager,queryBean,httpResponse);
}

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean;
import au.com.royalpay.payment.manage.analysis.core.BDAnalysisService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.CommonConsts;
import com.alibaba.fastjson.JSONObject;
@ -25,6 +26,7 @@ public class BDSaleAnalysisController {
private BDAnalysisService bdAnalysisService;
@ManagerMapping("/sales")
@ReadOnlyConnection
public List<JSONObject> getSalesAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
if (manager.getInteger("org_id") != null) {
@ -37,26 +39,31 @@ public class BDSaleAnalysisController {
}
@ManagerMapping("/sales/partners")
@ReadOnlyConnection
public List<JSONObject> getSalesPartnerAnalysis(AnalysisBean analysis) {
return bdAnalysisService.getSalesPartnersByBD(analysis.toParams(null));
}
@ManagerMapping("/sales/partners/excel")
@ReadOnlyConnection
public void exportExcel(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception {
bdAnalysisService.exportSalesExcel(analysis,httpResponse,manager);
}
@ManagerMapping("/sales/partners/report")
@ReadOnlyConnection
public List<JSONObject> getBDSalePartnerReport(AnalysisBean analysis){
return bdAnalysisService.getSalesPartnersReportByBD(analysis.toParams(null));
}
@ManagerMapping("/sales/partners/excel_bd")
@ReadOnlyConnection
public void exportPartnerExcelByBd(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception {
bdAnalysisService.exportPartnerExcelByBd(analysis,httpResponse,manager);
}
@ManagerMapping("/sales/partners/excel_data")
@ReadOnlyConnection
public void exportPartnerExcelByData(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception {
bdAnalysisService.exportPartnerExcelByData(analysis,httpResponse,manager);
}

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean;
import au.com.royalpay.payment.manage.analysis.core.ChannelsAnalysisService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.CommonConsts;
import com.alibaba.fastjson.JSONObject;
@ -55,6 +56,7 @@ public class ChannelsAnalysisController {
}
@ManagerMapping(value = "/alipay/data/export")
@ReadOnlyConnection
public void exportAlipayData(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse reps) {
JSONObject params = analysis.toParams(null);
if (manager.getInteger("org_id") != null) {

@ -4,6 +4,7 @@ import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.analysis.beans.ClientRateQueryBean;
import au.com.royalpay.payment.manage.analysis.core.ClientRatesAnalysisService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.manage.signin.core.ManagerAccountsService;
import au.com.royalpay.payment.tools.CommonConsts;
@ -33,6 +34,7 @@ public class ClientRatesController {
private ManagerAccountsService managerAccountsService;
@RequestMapping("/bd_users")
@ReadOnlyConnection
public JSONObject listAnalysisOfBDUsers(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,
@RequestParam(name = "org_id", required = false) String orgId,
@RequestParam(name = "org_id2", required = false) String orgId2,
@ -53,6 +55,7 @@ public class ClientRatesController {
}
@RequestMapping("/orgs/all")
@ReadOnlyConnection
public JSONObject analysisAllClientsRates(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,
@Valid ClientRateQueryBean query, Errors errors) {
if (manager.getIntValue("org_id") > 0) {
@ -73,6 +76,7 @@ public class ClientRatesController {
}
@RequestMapping("/bd_users/{bdId}")
@ReadOnlyConnection
public JSONObject analysisClientsOfBdUser(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String bdId,
@Valid ClientRateQueryBean query, Errors errors) {
if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role")) && !manager.getString("manager_id").equals(bdId) ) {

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean;
import au.com.royalpay.payment.manage.analysis.core.CustomersAnalysisService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
@ -29,6 +30,7 @@ public class CustomersAnalysisController {
private CustomersAnalysisService customersAnalysisService;
@ManagerMapping("/sys")
@ReadOnlyConnection
public List<JSONObject> getCustomersAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
if (manager.getInteger("org_id") != null) {
@ -44,6 +46,7 @@ public class CustomersAnalysisController {
}
@ManagerMapping("/sys/monthly")
@ReadOnlyConnection
public List<JSONObject> getCustomersAnalysisMonthly(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
if (manager.getInteger("org_id") != null) {
@ -60,6 +63,7 @@ public class CustomersAnalysisController {
@ManagerMapping("/sys/channel")
@ReadOnlyConnection
public JSONObject getCustomersChannelAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
if (manager.getInteger("org_id") != null) {
@ -75,6 +79,7 @@ public class CustomersAnalysisController {
}
@ManagerMapping("/sys/cbbank_channel")
@ReadOnlyConnection
public JSONObject getCBBankChannelAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
if (manager.getInteger("org_id") != null) {
@ -90,6 +95,7 @@ public class CustomersAnalysisController {
}
@ManagerMapping(value = "/ranking/{openid_type}",role = ManagerRole.DEVELOPER)
@ReadOnlyConnection
public JSONObject getCustomersRanking(@PathVariable int openid_type, AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
params.put("openid_type",openid_type);
@ -101,6 +107,7 @@ public class CustomersAnalysisController {
}
@ManagerMapping(value = "/ranking/{openid_type}/total",role = ManagerRole.RISK_MANAGER)
@ReadOnlyConnection
public JSONObject getCustomersTotal(@PathVariable int openid_type, AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
params.put("openid_type",openid_type);
@ -112,6 +119,7 @@ public class CustomersAnalysisController {
}
@ManagerMapping(value = "/{customer_id}/orders",role = ManagerRole.DEVELOPER)
@ReadOnlyConnection
public JSONObject getCustomerOrders(@PathVariable String customer_id, TradeLogQuery tradeLogQuery, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = tradeLogQuery.toParams(null);
params.put("customer_id",customer_id);

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.manage.analysis.core.DailyReport;
import au.com.royalpay.payment.manage.application.core.SimpleClientService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
@ -43,6 +44,7 @@ public class DailyReportController {
}
@WechatMapping(value = "/greenChannel", method = RequestMethod.GET)
@ReadOnlyConnection
public ModelAndView greenChannel(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser) {
Map<String, JSONObject> clients = simpleClientService.getGreenChannelClients(null);
List<JSONObject> resultWaringClients = new ArrayList<>();
@ -84,6 +86,7 @@ public class DailyReportController {
}
@WechatMapping(value = "/greenChannelBD/{manager_id}", method = RequestMethod.GET)
@ReadOnlyConnection
public ModelAndView greenChanneasdl(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser, @PathVariable String manager_id) {
Map<String, JSONObject> clients = simpleClientService.getGreenChannelClients(manager_id);
String resultWaringClients = "";

@ -4,6 +4,7 @@ import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean;
import au.com.royalpay.payment.manage.analysis.core.DashboardService;
import au.com.royalpay.payment.manage.organizations.core.OrgManager;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.manage.permission.manager.RequirePartner;
@ -30,6 +31,7 @@ public class DashboardController {
@ManagerMapping("/common_analysis_1")
@ReadOnlyConnection
public JSONObject commonAnalysis1(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(analysis.getTimezone());
orgManager.checkOrg(manager,params);
@ -37,6 +39,7 @@ public class DashboardController {
}
@ManagerMapping("/common_analysis_3")
@ReadOnlyConnection
public JSONObject commonAnalysis3(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(analysis.getTimezone());
orgManager.checkOrg(manager,params);
@ -44,6 +47,7 @@ public class DashboardController {
}
@ManagerMapping("/common_analysis_4")
@ReadOnlyConnection
public JSONObject commonAnalysis4(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(analysis.getTimezone());
orgManager.checkOrg(manager,params);
@ -51,6 +55,7 @@ public class DashboardController {
}
@ManagerMapping("/common_analysis_2")
@ReadOnlyConnection
public JSONObject commonAnalysis2(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(analysis.getTimezone());
orgManager.checkOrg(manager,params);
@ -58,6 +63,7 @@ public class DashboardController {
}
@ManagerMapping("/trade_in_types")
@ReadOnlyConnection
public List<JSONObject> tradeInTypes(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(analysis.getTimezone());
orgManager.checkOrg(manager,params);
@ -65,6 +71,7 @@ public class DashboardController {
}
@ManagerMapping("/top_trade_partners")
@ReadOnlyConnection
public List<JSONObject> topTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,
@RequestParam(defaultValue = "10") int limit) {
@ -75,6 +82,7 @@ public class DashboardController {
}
@ManagerMapping("/rank_trade_partners")
@ReadOnlyConnection
public List<JSONObject> rankTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
orgManager.checkOrg(manager, params);
@ -88,6 +96,7 @@ public class DashboardController {
}
@ManagerMapping("/trade_in_hours")
@ReadOnlyConnection
public List<JSONObject> tradeInHours(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
orgManager.checkOrg(manager,params);
@ -101,6 +110,7 @@ public class DashboardController {
}
@ManagerMapping("/fee_analysis")
@ReadOnlyConnection
public List<JSONObject> tradeInDays(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
orgManager.checkOrg(manager,params);
@ -108,6 +118,7 @@ public class DashboardController {
}
@ManagerMapping("/new_clients")
@ReadOnlyConnection
public List<JSONObject> clientsTradeInDays(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
orgManager.checkOrg(manager,params);
@ -115,6 +126,7 @@ public class DashboardController {
}
@ManagerMapping("/partners_in_types")
@ReadOnlyConnection
public List<JSONObject> partnersInTypes(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(analysis.getTimezone());
orgManager.checkOrg(manager,params);
@ -128,6 +140,7 @@ public class DashboardController {
}
@ManagerMapping("/gateway/{trade_type}/partners")
@ReadOnlyConnection
public List<JSONObject> getPartnersByTradeType(@PathVariable String trade_type, AnalysisBean analysis,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
@ -144,6 +157,7 @@ public class DashboardController {
}
@ManagerMapping("/trade_in_time")
@ReadOnlyConnection
public List<JSONObject> tradeInTime(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
orgManager.checkOrg(manager,params);
@ -151,17 +165,20 @@ public class DashboardController {
}
@ManagerMapping("/exchange_rates")
@ReadOnlyConnection
@RequirePartner
public List<JSONObject> getExchangeRateHistory(@RequestParam String begin, @RequestParam String end) {
return dashboardService.listExchangeRateHistory(begin, end);
}
@ManagerMapping("/max_record")
@ReadOnlyConnection
public JSONObject getMaxRecord(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return dashboardService.getNewRecord();
}
@ManagerMapping("/Total_platform_amount")
@ReadOnlyConnection
public JSONObject getPlatformAmount(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){
JSONObject params = analysis.toParams(analysis.getTimezone());
orgManager.checkOrg(manager,params);
@ -169,6 +186,7 @@ public class DashboardController {
}
@ManagerMapping(value = "/dashboard_base", method = RequestMethod.GET)
@ReadOnlyConnection
public JSONObject getDashBoardBaseConfig() {
JSONObject config = sysConfigManager.getSysConfig();
JSONObject limits = new JSONObject();

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.manage.analysis.core.EstimateAnalysisService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
@ -19,6 +20,7 @@ public class EstimateAnalysisController {
private EstimateAnalysisService estimateAnalysisService;
@ManagerMapping(value = "/future",method = RequestMethod.GET)
@ReadOnlyConnection
public List<JSONObject> getFutureSettleInfo() throws Exception {
return estimateAnalysisService.listFutureInfo();
}
@ -29,17 +31,20 @@ public class EstimateAnalysisController {
}
@ManagerMapping(value = "/log/{date}", method = RequestMethod.GET)
@ReadOnlyConnection
public List<JSONObject> getEstimateLogInfo(@PathVariable String date) throws Exception {
return estimateAnalysisService.listEstimateLog(1, date);
}
@ManagerMapping(value = "/transaction/log/{date}",method = RequestMethod.GET)
@ReadOnlyConnection
public List<JSONObject> getTransactionLogInfo(@PathVariable String date) throws Exception {
return estimateAnalysisService.listEstimateLog(2,date);
}
@ManagerMapping(value = "/query", method = RequestMethod.GET)
@ReadOnlyConnection
public List<JSONObject> queryEstimateLogInfo(@RequestParam String start_date, @RequestParam String end_date) throws Exception {
return estimateAnalysisService.listEstimateLogs(start_date,end_date);
}

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.analysis.core.OrderSuccessRateAnalysisService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
@ -24,6 +25,7 @@ public class OrderSuccessRateController {
private OrderSuccessRateAnalysisService orderSuccessRateAnalysisService;
@RequestMapping("/chart_view")
@ReadOnlyConnection
public JSONObject analysisAllInTypes(@RequestParam String begin, @RequestParam String end) {
Date beginDate;
try {
@ -41,6 +43,7 @@ public class OrderSuccessRateController {
}
@RequestMapping("/dates/{pattern}/detail")
@ReadOnlyConnection
public JSONObject getDetailOfDate(@PathVariable String pattern) {
Date dt = null;
try {

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean;
import au.com.royalpay.payment.manage.analysis.core.OrgAnalysisService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.CommonConsts;
import com.alibaba.fastjson.JSONObject;
@ -21,12 +22,14 @@ public class OrgSaleAnalysisController {
private OrgAnalysisService orgAnalysisService;
@ManagerMapping(value = "/sales",role = {ManagerRole.DIRECTOR,ManagerRole.OPERATOR,ManagerRole.ADMIN,ManagerRole.FINANCIAL_STAFF})
@ReadOnlyConnection
public List<JSONObject> getSalesAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
return orgAnalysisService.getSalesAnalysis(params,manager);
}
@ManagerMapping(value = "/{org_id}/partners",role = {ManagerRole.DIRECTOR,ManagerRole.OPERATOR,ManagerRole.ADMIN,ManagerRole.FINANCIAL_STAFF})
@ReadOnlyConnection
public List<JSONObject> getPartnersSales(@PathVariable String org_id, AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
analysis.setOrg_id(org_id);
JSONObject params = analysis.toParams(null);

@ -4,6 +4,7 @@ import au.com.royalpay.payment.manage.analysis.core.PartnerCardDashboardService;
import au.com.royalpay.payment.manage.logview.beans.ClientLoginLogQueryBean;
import au.com.royalpay.payment.manage.management.clearing.core.CleanService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.manage.signin.core.ClientLoginLogRepository;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
@ -34,52 +35,62 @@ public class PartnerCardDashboardController {
private CleanService cleanService;
@RequestMapping("{client_moniker}/basic_info")
@ReadOnlyConnection
public JSONObject commonAnalysis(@PathVariable String client_moniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return partnerCardDashboardService.getCommonAnalysis(client_moniker);
}
@RequestMapping("{client_moniker}/trans_common")
@ReadOnlyConnection
public JSONObject getTransactionAnalysis(@PathVariable String client_moniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return partnerCardDashboardService.getTransactionAnalysis(client_moniker);
}
@RequestMapping("{client_moniker}/order_customer_chart")
@ReadOnlyConnection
public List<JSONObject> getOrderCustomerChartAnalysis(@PathVariable String client_moniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return partnerCardDashboardService.getOrderCustomerChartAnalysis(client_moniker);
}
@RequestMapping("{client_moniker}/trans_type_analysis")
@ReadOnlyConnection
public List<JSONObject> getTransTypesAnalysis(@PathVariable String client_moniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return partnerCardDashboardService.getTransTypesAnalysis(client_moniker);
}
@RequestMapping("{client_moniker}/avg_order_customer")
@ReadOnlyConnection
public JSONObject getAvgOrderAndCustomer(@PathVariable String client_moniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return partnerCardDashboardService.getOrderAndCustomerPerDay(client_moniker);
}
@RequestMapping("{client_moniker}/trade_in_hours")
@ReadOnlyConnection
public List<JSONObject> getTradeAnalysisInHours(@PathVariable String client_moniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return partnerCardDashboardService.getTradeAnalysisInHours(client_moniker);
}
@RequestMapping("{client_moniker}/settlement_logs")
@ReadOnlyConnection
public JSONObject getPartnerSettlementLog(@PathVariable String client_moniker, TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return partnerCardDashboardService.getSettlementLog(client_moniker, query);
}
@RequestMapping("{client_moniker}/login_logs")
@ReadOnlyConnection
public JSONObject getPartnerLoginLog(@PathVariable String client_moniker, ClientLoginLogQueryBean query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientLoginLogRepository.listClientLoginLogs(client_moniker, query.getPage(), query.getLimit());
}
@RequestMapping("/{client_id}/settlement_logs/{detailId}")
@ReadOnlyConnection
public JSONObject listClearingTransactions(@PathVariable int client_id, @PathVariable int detailId,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return cleanService.getCleanLogTransactions(detailId, manager);
}
@RequestMapping("/settlement_logs/{detailId}/analysis/{channel}")
@ReadOnlyConnection
public Map<String,JSONObject> getDayAndChannelOfAnalysisMap(@PathVariable int detailId,
@PathVariable String channel, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return cleanService.getDayAndChannelOfAnalysisMap(detailId,channel, manager);

@ -6,6 +6,7 @@ import au.com.royalpay.payment.manage.analysis.core.PartnerCardDashboardService;
import au.com.royalpay.payment.manage.logview.beans.ClientLoginLogQueryBean;
import au.com.royalpay.payment.manage.management.clearing.core.CleanService;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.manage.signin.core.ClientLoginLogRepository;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.tools.CommonConsts;
@ -31,25 +32,30 @@ public class PartnerDashboardController {
private CleanService cleanService;
@PartnerMapping("/common_analysis")
@ReadOnlyConnection
public JSONObject commonAnalysis(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, AnalysisBean partnerAnalysisBean) {
return dashboardService.getCommonAnalysis(partner,partnerAnalysisBean);
}
@PartnerMapping("/trade_in_hours")
@ReadOnlyConnection
public List<JSONObject> tradeInHours(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,AnalysisBean partnerAnalysisBean) {
return dashboardService.getTradeAnalysisInHours(partner,partnerAnalysisBean);
}
@PartnerMapping("/fee_analysis")
@ReadOnlyConnection
public List<JSONObject> tradeInDays(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,AnalysisBean partnerAnalysisBean) {
return dashboardService.getStatisticsCustomersAndOrdersInDays(partner,partnerAnalysisBean);
}
@PartnerMapping("/customers")
@ReadOnlyConnection
public List<JSONObject> customersInDays(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,AnalysisBean partnerAnalysisBean) {
return dashboardService.getCustomersAndOrdersInDays(partner,partnerAnalysisBean);
}
@PartnerMapping("/trans_type_analysis")
@ReadOnlyConnection
public List<JSONObject> getTransTypesAnalysis(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,AnalysisBean partnerAnalysisBean) {
JSONObject params = partnerAnalysisBean.toParams("timezone");
params.put("client_id",partner.getString("client_id"));
@ -57,6 +63,7 @@ public class PartnerDashboardController {
}
@PartnerMapping("/avg_order_customer")
@ReadOnlyConnection
public JSONObject getAvgOrderAndCustomer(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,AnalysisBean partnerAnalysisBean) {
return dashboardService.getOrderAndCustomerPerDay(partner,partnerAnalysisBean);
}

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean;
import au.com.royalpay.payment.manage.analysis.core.PartnersAnalysisService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.CommonConsts;
import com.alibaba.fastjson.JSONObject;
@ -24,6 +25,7 @@ public class PartnersAnalysisController {
private PartnersAnalysisService partnersAnalysisService;
@ManagerMapping("/new")
@ReadOnlyConnection
public List<JSONObject> getNewPartnersAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
if (manager.getInteger("org_id") != null) {
@ -39,6 +41,7 @@ public class PartnersAnalysisController {
}
@ManagerMapping("/trade")
@ReadOnlyConnection
public List<JSONObject> getTradePartnersAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
if (manager.getInteger("org_id") != null) {
@ -53,6 +56,7 @@ public class PartnersAnalysisController {
return partnersAnalysisService.getTradePartnersAnalysis(params);
}
@ManagerMapping("/types")
@ReadOnlyConnection
public List<JSONObject> getPartnersTypesAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
if (manager.getInteger("org_id") != null) {
@ -68,6 +72,7 @@ public class PartnersAnalysisController {
}
@ManagerMapping("/settlement")
@ReadOnlyConnection
public List<JSONObject> getPartnersSettlementAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null);
if (manager.getInteger("org_id") != null) {

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.manage.analysis.core.PlatformClearService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject;
@ -25,21 +26,25 @@ public class PlatformClearAController {
private PlatformClearService platformClearService;
@ManagerMapping(value = "/settle/log", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.DEVELOPER})
@ReadOnlyConnection
public JSONObject getPlatformSettleLog(@RequestParam String channel, @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "20") int limit) {
return platformClearService.getPlatformSettleLog(channel, page, limit);
}
@ManagerMapping(value = "/settle/{channel}",method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.DEVELOPER})
@ReadOnlyConnection
public JSONObject getChannelSettleLog(@PathVariable String channel) {
return platformClearService.getChannelSettleLog(channel);
}
@ManagerMapping(value = "/settle/verify",method = RequestMethod.GET,role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.DEVELOPER})
@ReadOnlyConnection
public void verifySettleLogByDate(@RequestParam("start_date") String start_date, @RequestParam("end_date") String end_date, @RequestParam("channel") String channel) throws ParseException {
platformClearService.verifySettleLogByDate(start_date,end_date,channel);
}
@ManagerMapping(value = "/generate/settle/log", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.DEVELOPER})
@ReadOnlyConnection
public void generateSettleLogs() {
platformClearService.generateSettleLogs();
}

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.analysis.core.PlatformRevenueService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
import org.joda.time.DateTime;
@ -29,6 +30,7 @@ public class PlatformRevenueController {
PlatformRevenueService platformRevenueService;
@RequestMapping(value = "/revenue/month_reports/{month}", method = RequestMethod.GET)
@ReadOnlyConnection
public JSONObject getMonthPlatformRevenueReport(@PathVariable String month) {
try {
Date dt = DateUtils.parseDate(month, new String[]{"yyyy-MM"});
@ -42,6 +44,7 @@ public class PlatformRevenueController {
}
@RequestMapping(value = "/revenue/year_reports/{year}", method = RequestMethod.GET)
@ReadOnlyConnection
public List<JSONObject> getYearPlatformRevenueReport(@PathVariable int year) {
List<JSONObject> platformRevenueYearReport = new ArrayList<JSONObject>();
int MonthIndex = 13;

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.manage.analysis.core.WeekReporter;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
@ -21,6 +22,7 @@ public class WeekReportController {
private WeekReporter weekReporter;
@WechatMapping(value = "/{reportId}", method = RequestMethod.GET)
@ReadOnlyConnection
public ModelAndView reportView(@PathVariable String reportId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser) {
ModelAndView mav = new ModelAndView("reports/week_report");
JSONObject report = weekReporter.getReport(reportId, wxUser.getString("openid"));
@ -29,6 +31,7 @@ public class WeekReportController {
}
@WechatMapping(value = "/partners/{reportId}", method = RequestMethod.GET)
@ReadOnlyConnection
public ModelAndView reportPartnersView(@PathVariable String reportId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser) {
ModelAndView mav = new ModelAndView("reports/week_report_partners");
JSONObject report = weekReporter.getReport(reportId, wxUser.getString("openid"));

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.cashback.web;
import au.com.royalpay.payment.manage.cashback.bean.CashbackQuery;
import au.com.royalpay.payment.manage.cashback.core.CashbackService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject;
@ -25,16 +26,19 @@ public class ManageCashbackController {
private CashbackService cashbackService;
@RequestMapping(value = "/daily",method = RequestMethod.GET)
@ReadOnlyConnection
public List<JSONObject> getCashbackDaily(CashbackQuery query){
return cashbackService.getCashbackDaily(query);
}
@RequestMapping(value = "/partners",method = RequestMethod.GET)
@ReadOnlyConnection
public JSONObject getCashbackPartners(CashbackQuery query){
return cashbackService.getPartnerCashback(query);
}
@RequestMapping(value = "/analysis",method = RequestMethod.GET)
@ReadOnlyConnection
public JSONObject getCashbackAnalysis(){
return cashbackService.getCashbackAnalysis();
}

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.dataAnalysis.web;
import au.com.royalpay.payment.manage.dataAnalysis.core.DataAnalysisService;
import au.com.royalpay.payment.manage.dataAnalysis.util.MyUtil;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -26,6 +27,7 @@ public class DataAnalysisController {
private DataAnalysisService dataAnalysisService;
@RequestMapping(value = "/data_analysis")
@ReadOnlyConnection
public JSONObject dataAnalysis(@RequestParam(value = "begin", required = false) String begin,
@RequestParam(value = "offset", defaultValue = "1") Integer offset) throws ParseException {

@ -5,6 +5,7 @@ import au.com.royalpay.payment.manage.merchants.beans.*;
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.RequireManager;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.tools.CommonConsts;
@ -430,16 +431,19 @@ public class PartnerManageController {
}
@ManagerMapping(value = "/{clientMoniker}/account/transactions", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
@ReadOnlyConnection
public List<JSONObject> accountTransactions(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) {
return clientManager.getAccountTransactions(manager, clientMoniker);
}
@ManagerMapping(value = "/{clientMoniker}/account/transactions/date", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
@ReadOnlyConnection
public List<JSONObject> accountTransactionsByDate(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestParam String detailId) {
return clientManager.getAccountTransactionsByDetailId(manager, clientMoniker, detailId);
}
@ManagerMapping(value = "/{clientMoniker}/account/save", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
@ReadOnlyConnection
public void saveAccountTransaction(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject transaction) {
clientManager.saveAccountTransaction(manager, clientMoniker, transaction);
}
@ -592,6 +596,7 @@ public class PartnerManageController {
}
@ManagerMapping(value = "/{clientMoniker}/lists_settlements", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR})
@ReadOnlyConnection
public JSONObject getSettlements(@PathVariable String clientMoniker, TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.getSettlementLog(manager, clientMoniker, query);
}

@ -9,6 +9,7 @@ import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.permission.manager.RequirePartner;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.manage.support.wechatclients.KangaLandWechatApiImpl;
import au.com.royalpay.payment.manage.support.wechatclients.RedpackWechatApiImpl;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
@ -178,12 +179,14 @@ public class PartnerViewController {
}
@PartnerMapping(value = "/{clientMoniker}/account/transactions", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ReadOnlyConnection
@ResponseBody
public List<JSONObject> accountTransactions(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker) {
return clientManager.getAccountTransactions(manager, clientMoniker);
}
@PartnerMapping(value = "/{clientMoniker}/account/transactions/date", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ReadOnlyConnection
@ResponseBody
public List<JSONObject> accountTransactionsByDate(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker,@RequestParam String date) {
return clientManager.getAccountTransactionsByDetailId(manager, clientMoniker, date);

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.settlement.web;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.manage.settlement.core.ManualSettleSupport;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
@ -23,6 +24,7 @@ public class ClientManualSettleController {
private ManualSettleSupport manualSettleSupport;
@PartnerMapping(value = "/today", method = RequestMethod.GET, roles = {PartnerRole.ADMIN})
@ReadOnlyConnection
public JSONObject checkRequestInToday(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return manualSettleSupport.findCurrentSettle(account.getIntValue("client_id"), true);
}

@ -1,6 +1,7 @@
package au.com.royalpay.payment.manage.system.web;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.manage.settlement.core.ManualSettleSupport;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
@ -25,6 +26,7 @@ public class contractController {
private ManualSettleSupport manualSettleSupport;
@ManagerMapping(value = "/contract/list", method = RequestMethod.GET)
@ReadOnlyConnection
public JSONObject contractList(@RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int limit,@RequestParam(required = false) String client_moniker) {
JSONObject params = new JSONObject();
params.put("client_moniker",client_moniker);
@ -32,11 +34,13 @@ public class contractController {
}
@ManagerMapping(value = "/contract", method = RequestMethod.GET)
@ReadOnlyConnection
public JSONObject contractAnalysis() {
return clientContractService.analysis();
}
@ManagerMapping(value = "/manualSettle/list", method = RequestMethod.GET)
@ReadOnlyConnection
public List<JSONObject> manualList() {
return manualSettleSupport.listWithClearInfo();
}

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.tradelog.web;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.manage.permission.manager.RequireManager;
import au.com.royalpay.payment.manage.permission.manager.RequirePartner;
@ -27,12 +28,14 @@ public class ManageTradelogController {
@Resource
private ClientManager clientManager;
@RequestMapping(method = RequestMethod.GET)
@ReadOnlyConnection
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR})
public JSONObject listAllTradeLogs(TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return tradeLogService.listAllTradeLogs(query, manager);
}
@ManagerMapping(value = "/{tradeId}/refunds", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR})
@ReadOnlyConnection
@RequirePartner
public List<JSONObject> listTradeRefunds(@PathVariable String tradeId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
@ -40,16 +43,19 @@ public class ManageTradelogController {
}
@ManagerMapping(value = "/report/excel", method = RequestMethod.GET)
@ReadOnlyConnection
public void exportExcel(TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception {
tradeLogService.exportTransLog(query,manager,httpResponse);
}
@ManagerMapping(value = "/trans_flow",method = RequestMethod.GET,role = {ManagerRole.FINANCIAL_STAFF})
@ReadOnlyConnection
public JSONObject listTransFlow(TradeLogQuery query,@RequestParam(required = true) String client_moniker) throws Exception {
return tradeLogService.listPartnerTransFlowPage(query,getPartnerParams(client_moniker));
}
@ManagerMapping(value = "/trans_flow/pdf", method = RequestMethod.GET,role = {ManagerRole.FINANCIAL_STAFF})
@ReadOnlyConnection
public void exportTransFlowPDF(TradeLogQuery query, @RequestParam(required = true) String client_moniker, HttpServletResponse httpResponse) throws Exception {
tradeLogService.exportTransFlow(query,getPartnerParams(client_moniker),httpResponse);
}

@ -1,5 +1,6 @@
package au.com.royalpay.payment.manage.tradelog.web;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType;
@ -26,12 +27,14 @@ public class PayNoticeController {
private TradeLogService tradeLogService;
@WechatMapping(value = "/orders/{orderId}/notice", method = RequestMethod.GET, oauthType = WxOauthType.USERBASE)
@ReadOnlyConnection
public String noticeView(Model model, @PathVariable String clientMoniker, @PathVariable String orderId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechat) {
tradeLogService.getOrderDetail(model, clientMoniker, orderId, wechat.getString("openid"));
return "paynotice";
}
@WechatMapping(value = "/refunds/{refundId}/status", method = RequestMethod.GET, oauthType = WxOauthType.USERBASE)
@ReadOnlyConnection
public String refundStatus(Model model, @PathVariable String clientMoniker, @PathVariable String refundId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wechat) {
tradeLogService.getRefundStatus(model, clientMoniker, refundId, wechat.getString("openid"));
return "refund_status";

@ -5,6 +5,7 @@ import au.com.royalpay.payment.manage.mappers.payment.RefundReviewMapper;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.permission.manager.RequireManager;
import au.com.royalpay.payment.manage.permission.manager.RequirePartner;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.manage.tradelog.refund.RefundService;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
@ -31,6 +32,7 @@ public class RefundController {
@RequestMapping(value = "/orders/{orderId}/refund_check", method = RequestMethod.GET)
@ReadOnlyConnection
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT})
@RequirePartner
public JSONObject refundCheck(@PathVariable String orderId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
@ -44,24 +46,28 @@ public class RefundController {
}
@RequestMapping(value = "/orders/{orderId}/refund_orderInfo", method = RequestMethod.GET)
@ReadOnlyConnection
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT})
public JSONObject refundOrderInfo(@PathVariable String orderId) {
return refundService.checkOrderRefundInfo(orderId);
}
@RequestMapping(value = "/orders/needReview", method = RequestMethod.GET)
@ReadOnlyConnection
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT})
public JSONObject listNeedReviewRefundOrders(RefundReviewBean reviewBean) {
return refundService.listNeedReviewRefundOrders(reviewBean);
}
@RequestMapping(value = "/orders/notifyReview", method = RequestMethod.GET)
@ReadOnlyConnection
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT})
public int notifyReviewRefundOrders() {
return refundService.notifyRefundReview();
}
@WechatMapping(value = "/auditions", method = RequestMethod.GET)
@ReadOnlyConnection
public ModelAndView auditionListPage(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject user) {
ModelAndView view = new ModelAndView("refund_audit_list");
view.addAllObjects(refundService.auditionsFromOpenId(user.getString("openid")));
@ -69,6 +75,7 @@ public class RefundController {
}
@WechatMapping(value = "/auditions/{auditionId}", method = RequestMethod.GET)
@ReadOnlyConnection
public ModelAndView auditionPage(@PathVariable String auditionId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject user) {
ModelAndView view = new ModelAndView("refund_audit");
view.addAllObjects(refundService.auditionInfo(auditionId, user.getString("openid")));
@ -76,11 +83,13 @@ public class RefundController {
}
@RequestMapping(value = "/json/auditions", method = RequestMethod.GET)
@ReadOnlyConnection
public JSONObject auditionListPageJson(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return refundService.auditionsFromAccount(account);
}
@RequestMapping(value = "/json/auditions/{auditionId}", method = RequestMethod.GET)
@ReadOnlyConnection
public JSONObject auditionPageJson(@PathVariable String auditionId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return refundService.auditionInfoByAccount(auditionId, account);
}
@ -91,6 +100,7 @@ public class RefundController {
}
@RequestMapping(value = "/review/{reviewId}", method = RequestMethod.GET)
@ReadOnlyConnection
public ModelAndView reviewRefundPage(@PathVariable String reviewId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject user) {
ModelAndView view = new ModelAndView("refund_review");
view.addObject("review", refundService.findReviewOrder(reviewId));
@ -98,6 +108,7 @@ public class RefundController {
}
@RequestMapping(value = "/review/check/{reviewId}", method = RequestMethod.GET)
@ReadOnlyConnection
public ModelAndView refundStatusCheck(@PathVariable String reviewId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject user) {
ModelAndView view = new ModelAndView("refund_review_client");
view.addObject("review", refundService.findReviewOrder(reviewId));

@ -1,5 +1,6 @@
package au.com.royalpay.payment.manage.tradelog.web;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.manage.permission.manager.RequireManager;
import au.com.royalpay.payment.manage.tradelog.core.ReportConfigService;
@ -19,12 +20,14 @@ public class ReportConfigController {
private ReportConfigService reportConfigService;
@RequestMapping(method = RequestMethod.GET)
@ReadOnlyConnection
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR,ManagerRole.FINANCIAL_STAFF})
public JSONObject listReprtConfg(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return reportConfigService.getReportConfig();
}
@RequestMapping(value = "/{pkid}",method = RequestMethod.GET)
@ReadOnlyConnection
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR,ManagerRole.FINANCIAL_STAFF})
public JSONObject getReportConfigDetail(@PathVariable int pkid, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return reportConfigService.findOne(pkid);

@ -1,6 +1,7 @@
package au.com.royalpay.payment.manage.tradelog.web;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.tools.CommonConsts;
@ -25,6 +26,7 @@ public class TradeFlowController {
private TradeLogService tradeLogService;
@PartnerMapping(value = "", method = RequestMethod.GET)
@ReadOnlyConnection
@ResponseBody
public JSONObject listTransFlow(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) throws Exception {
return tradeLogService.listPartnerTransFlowPage(query, partner);
@ -32,26 +34,31 @@ public class TradeFlowController {
@PartnerMapping(value = "/report/pdf", method = RequestMethod.GET)
@ReadOnlyConnection
public void exportPDF(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse httpResponse) throws Exception {
tradeLogService.exportTransFlow(query,partner,httpResponse);
}
@PartnerMapping(value = "/report/excel", method = RequestMethod.GET)
@ReadOnlyConnection
public void exportExcel(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse httpResponse) throws Exception {
tradeLogService.exportExcelNew(query,partner,httpResponse);
}
@PartnerMapping(value = "/report/excel_detail", method = RequestMethod.GET)
@ReadOnlyConnection
public void exportExcelDetail(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse httpResponse) throws Exception {
tradeLogService.exportExcel(query,partner,httpResponse);
}
@PartnerMapping(value = "/settlement/log",method = RequestMethod.GET)
@ReadOnlyConnection
@ResponseBody
public JSONObject listSettlementLog(TradeLogQuery query,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner){
return tradeLogService.listSettlementLog(query,partner);
}
@PartnerMapping(value = "/settlement/unclear",method = RequestMethod.GET)
@ReadOnlyConnection
@ResponseBody
public String getClientUnClearedAmount(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner){
// JSONObject res = new JSONObject();
@ -60,18 +67,21 @@ public class TradeFlowController {
}
@PartnerMapping(value = "/settlement/log/excel",method = RequestMethod.GET)
@ReadOnlyConnection
@ResponseBody
public void exportSettlementLog(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse response) {
tradeLogService.exportSettlementLog(query, partner, response);
}
@PartnerMapping(value = "/settlement/log/pdf",method = RequestMethod.GET)
@ReadOnlyConnection
@ResponseBody
public void exportLogPDF(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse response) {
tradeLogService.exportPDFSettlement(query, partner, response);
}
@PartnerMapping(value = "/report/excel_detail_all", method = RequestMethod.GET)
@ReadOnlyConnection
public void exportExcelDetailAllPartner(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse httpResponse) throws Exception {
tradeLogService.exportExcelAllPartner(query,partner,httpResponse);
}

@ -2,8 +2,8 @@
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<property name="LOG_FILE" value="/var/log/payment/payment.log"/>
<property name="CONSOLE_LOG_PATTERN" value="[%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){blue}] %clr(%-5level) %logger: %msg%n"/>
<property name="FILE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger: %msg%n"/>
<property name="CONSOLE_LOG_PATTERN" value="[%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){blue}] %clr(%-5level) %logger{32}: %msg%n"/>
<property name="FILE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{32}: %msg%n"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />
<appender name="ROLLIN" class="ch.qos.logback.core.rolling.RollingFileAppender">

Loading…
Cancel
Save