From 5f633305c181de05ea911b4f183aa18448caed35 Mon Sep 17 00:00:00 2001 From: yixian Date: Mon, 6 May 2019 17:09:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0autosql=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=EF=BC=8Csql=E4=BC=98=E5=8C=96=EF=BC=88=E9=83=A8=E5=88=86?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mappers/ClientAnalysisMapper.java | 5 +- .../CustomerAndOrdersStatisticsMapper.java | 7 +- .../analysis/mappers/OrderAnalysisMapper.java | 4 + .../mappers/TransactionAnalysisMapper.java | 12 +- .../clearing/web/ArrivalNoticeController.java | 2 - .../mappers/act/ActDietAttendMapper.java | 3 +- .../FinancialBDRateConfigMapper.java | 3 +- .../log/ClearingDetailAnalysisMapper.java | 3 +- .../mappers/log/ClearingDetailMapper.java | 3 +- .../manage/mappers/log/ClearingLogMapper.java | 3 +- .../mappers/log/ValidationLogMapper.java | 3 +- .../mappers/payment/TransactionMapper.java | 3 +- .../preapply/SysClientPreMapperMapper.java | 3 +- .../mappers/redpack/ActBlackListMapper.java | 2 +- .../system/ClientBankAccountMapper.java | 3 +- .../manage/mappers/system/ClientMapper.java | 3 +- .../mappers/system/ClientRateMapper.java | 3 +- .../manage/mappers/system/CustomerMapper.java | 3 +- .../manage/mappers/system/OrgMapper.java | 3 +- .../system/PermissionPartnerModuleMapper.java | 14 +- .../mappers/system/ReportConfigMapper.java | 3 +- .../core/impls/ClientManagerImpl.java | 79 ++------ .../core/impls/SignInAccountServiceImpl.java | 15 +- .../CustomerAndOrdersStatisticsMapper.xml | 45 ++++- .../analysis/mappers/OrderAnalysisMapper.xml | 30 +++ .../mappers/TransactionAnalysisMapper.xml | 178 ++++++++++++------ .../mappers/payment/TransactionMapper.xml | 9 +- 27 files changed, 274 insertions(+), 170 deletions(-) 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 c1644b28c..d2c05d82d 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 @@ -7,6 +7,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.SqlType; import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; import java.util.Date; import java.util.List; @@ -14,7 +15,7 @@ import java.util.List; /** * Created by davep on 2016-07-28. */ -@AutoMapper(tablename = "sys_clients", pkName = "client_id", pkAutoIncrement = true) +@AutoMapper(tablename = "sys_clients", pkName = "client_id", keyGenerator = Jdbc3KeyGenerator.class) public interface ClientAnalysisMapper { int countNewClients(JSONObject params); @@ -45,7 +46,7 @@ public interface ClientAnalysisMapper { List notTradeSubMerchantId(); - List tradeSubMerchantIdBy60Days(@Param("begin")Date begin); + List tradeSubMerchantIdBy60Days(@Param("begin") Date begin); List countClientsSettlementCycle(JSONObject params); } diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.java b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.java index 4a80f3efb..e651fb951 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.java @@ -1,7 +1,9 @@ package au.com.royalpay.payment.manage.analysis.mappers; + import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; +import cn.yixblog.support.mybatis.paginator.annotations.CountRef; import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; @@ -12,7 +14,7 @@ import java.util.List; /** * Created by yishuqian on 09/11/2016. */ -@AutoMapper(tablename = "statistics_customer_order",pkName = "id") +@AutoMapper(tablename = "statistics_customer_order", pkName = "id") public interface CustomerAndOrdersStatisticsMapper { @AutoSql(type = SqlType.INSERT) void save(JSONObject jsonObject); @@ -50,8 +52,11 @@ public interface CustomerAndOrdersStatisticsMapper { JSONObject getCommonCount(JSONObject params); + @CountRef(".countAreaMerchantTradeAnalysis") PageList getAreaMerchantTradeAnalysis(JSONObject params, PageBounds pageBounds); + int countAreaMerchantTradeAnalysis(JSONObject params); + List countTradedClientsByDate(JSONObject parasm); List getAreaMerchantTradeByLastCycle(JSONObject parasm); diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/OrderAnalysisMapper.java b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/OrderAnalysisMapper.java index 6193f3e36..6119fb777 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/OrderAnalysisMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/OrderAnalysisMapper.java @@ -1,5 +1,6 @@ package au.com.royalpay.payment.manage.analysis.mappers; +import cn.yixblog.support.mybatis.paginator.annotations.CountRef; import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; @@ -21,7 +22,10 @@ public interface OrderAnalysisMapper { JSONObject analysisOrderSuccessRateDetailOfGlobal(@Param("date") Date date); + @CountRef(".countCustomersData") PageList listCustomersData(JSONObject params, PageBounds pageBounds); + int countCustomersData(JSONObject params); + JSONObject listCustomersDataAnalysis(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 3e52621c3..bd09a889d 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 @@ -1,6 +1,7 @@ package au.com.royalpay.payment.manage.analysis.mappers; import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; +import cn.yixblog.support.mybatis.paginator.annotations.CountRef; import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; @@ -65,22 +66,29 @@ public interface TransactionAnalysisMapper { JSONObject getAmountRangeAnalysis(JSONObject params); + @CountRef(".countAmountRangeOrders") PageList listAmountRangeOrders(JSONObject params, PageBounds pagination); + int countAmountRangeOrders(JSONObject params); + BigDecimal getOneOrder(@Param("order_id") String order_id); int getCountCustomers(@Param("date") Date date); JSONObject getClientTransaction(JSONObject params); - PageList getAreaMerchantAmountAnalysis(JSONObject params,PageBounds pagination); + @CountRef(".countAreaMerchantAmountAnalysis") + PageList getAreaMerchantAmountAnalysis(JSONObject params, PageBounds pagination); + + int countAreaMerchantAmountAnalysis(JSONObject params); List getAreaMerchantAmountByCycle(JSONObject params); - JSONObject getOrderClearAmount(@Param("order_id") String order_id); + JSONObject getOrderClearAmount(@Param("order_id") String orderId); /** * 获取到cny_amount字段 + * * @param params * @return */ diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/ArrivalNoticeController.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/ArrivalNoticeController.java index 46919c3c8..99bfb4489 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/ArrivalNoticeController.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/ArrivalNoticeController.java @@ -4,9 +4,7 @@ import au.com.royalpay.payment.manage.mappers.log.ValidationLogMapper; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import netscape.javascript.JSObject; import org.apache.commons.lang3.time.DateUtils; -import org.apache.xerces.impl.validation.ValidationManager; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActDietAttendMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActDietAttendMapper.java index cb8d2479a..7b83f1a15 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActDietAttendMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActDietAttendMapper.java @@ -8,13 +8,14 @@ import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; import java.util.List; /** * Created by yixian on 2017-03-21. */ -@AutoMapper(tablename = "act_diet_attend", pkName = "attend_id", pkAutoIncrement = true) +@AutoMapper(tablename = "act_diet_attend", pkName = "attend_id", keyGenerator = Jdbc3KeyGenerator.class) public interface ActDietAttendMapper { @AutoSql(type = SqlType.SELECT) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDRateConfigMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDRateConfigMapper.java index 5b4c07c70..aefd33df5 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDRateConfigMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDRateConfigMapper.java @@ -4,13 +4,14 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; import com.alibaba.fastjson.JSONObject; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; import java.util.List; /** * Created by yixian on 2017-02-07. */ -@AutoMapper(tablename = "financial_bd_prize_rate_config", pkName = "config_id", pkAutoIncrement = true) +@AutoMapper(tablename = "financial_bd_prize_rate_config", pkName = "config_id", keyGenerator = Jdbc3KeyGenerator.class) public interface FinancialBDRateConfigMapper { @AutoSql(type = SqlType.SELECT) List listAllConfig(); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingDetailAnalysisMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingDetailAnalysisMapper.java index f97a11d43..e3909408a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingDetailAnalysisMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingDetailAnalysisMapper.java @@ -5,6 +5,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; import com.alibaba.fastjson.JSONObject; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; import java.math.BigDecimal; import java.util.Date; @@ -13,7 +14,7 @@ import java.util.List; /** * Created by yixian on 2017-03-21. */ -@AutoMapper(tablename = "log_clearing_detail_analysis", pkName = "detail_id", pkAutoIncrement = true) +@AutoMapper(tablename = "log_clearing_detail_analysis", pkName = "detail_id", keyGenerator = Jdbc3KeyGenerator.class) public interface ClearingDetailAnalysisMapper { @AutoSql(type = SqlType.INSERT) void save(JSONObject channel); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingDetailMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingDetailMapper.java index 62ff594d9..0d2a4b4a8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingDetailMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingDetailMapper.java @@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; import java.util.Date; import java.util.List; @@ -14,7 +15,7 @@ import java.util.List; /** * Created by davep on 2016-09-05. */ -@AutoMapper(tablename = "log_clearing_detail", pkAutoIncrement = true, pkName = "clear_detail_id") +@AutoMapper(tablename = "log_clearing_detail", keyGenerator = Jdbc3KeyGenerator.class, pkName = "clear_detail_id") public interface ClearingDetailMapper { @AutoSql(type = SqlType.INSERT) void save(JSONObject detail); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingLogMapper.java index 2a7d47b66..e6c3dbd14 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingLogMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ClearingLogMapper.java @@ -5,6 +5,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; import com.alibaba.fastjson.JSONObject; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; import java.util.Date; import java.util.List; @@ -12,7 +13,7 @@ import java.util.List; /** * Created by davep on 2016-09-04. */ -@AutoMapper(tablename = "log_clearing", pkName = "clearing_id", pkAutoIncrement = true) +@AutoMapper(tablename = "log_clearing", pkName = "clearing_id", keyGenerator = Jdbc3KeyGenerator.class) public interface ClearingLogMapper { @AutoSql(type = SqlType.INSERT) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.java index a020b435a..0aaa7fa60 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/log/ValidationLogMapper.java @@ -5,6 +5,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; import com.alibaba.fastjson.JSONObject; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; import java.util.Date; import java.util.List; @@ -12,7 +13,7 @@ import java.util.List; /** * Created by yixian on 2016-09-19. */ -@AutoMapper(tablename = "log_order_validation", pkName = "valid_id", pkAutoIncrement = true) +@AutoMapper(tablename = "log_order_validation", pkName = "valid_id", keyGenerator = Jdbc3KeyGenerator.class) public interface ValidationLogMapper { @AutoSql(type = SqlType.INSERT) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java index 657ceefd0..c7b6fe997 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java @@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; import java.math.BigDecimal; import java.util.Date; @@ -16,7 +17,7 @@ import java.util.List; /** * Created by yixian on 2016-07-01. */ -@AutoMapper(tablename = "pmt_transactions", pkName = "transaction_id", pkAutoIncrement = true) +@AutoMapper(tablename = "pmt_transactions", pkName = "transaction_id", keyGenerator = Jdbc3KeyGenerator.class) public interface TransactionMapper { @AutoSql(type = SqlType.INSERT) void save(JSONObject transaction); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/preapply/SysClientPreMapperMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/preapply/SysClientPreMapperMapper.java index 8efd2247d..cf7f8a7d0 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/preapply/SysClientPreMapperMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/preapply/SysClientPreMapperMapper.java @@ -11,8 +11,9 @@ import java.util.List; import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; -@AutoMapper(tablename = "sys_client_pre_apply", pkName = "client_pre_apply_id",pkAutoIncrement = true) +@AutoMapper(tablename = "sys_client_pre_apply", pkName = "client_pre_apply_id",keyGenerator = Jdbc3KeyGenerator.class) public interface SysClientPreMapperMapper { @AutoSql(type = SqlType.UPDATE) void update(JSONObject data); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActBlackListMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActBlackListMapper.java index 02c2cefd2..bc0af37d2 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActBlackListMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/redpack/ActBlackListMapper.java @@ -11,7 +11,7 @@ import java.util.List; /** * Created by yishuqian on 04/01/2017. */ -@AutoMapper(tablename = "act_black_list") +@AutoMapper(tablename = "act_black_list", pkName = {"act_id", "client_id"}) public interface ActBlackListMapper { @AutoSql(type = SqlType.INSERT) void save(JSONObject blackObj); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientBankAccountMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientBankAccountMapper.java index e05153b8c..26933d2d9 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientBankAccountMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientBankAccountMapper.java @@ -5,13 +5,14 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; import com.alibaba.fastjson.JSONObject; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; import java.util.List; /** * Created by davep on 2016-08-16. */ -@AutoMapper(tablename = "sys_bank_accounts", pkAutoIncrement = true, pkName = "bank_account_id") +@AutoMapper(tablename = "sys_bank_accounts", keyGenerator = Jdbc3KeyGenerator.class, pkName = "bank_account_id") public interface ClientBankAccountMapper { @AutoSql(type = SqlType.SELECT) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index 84e2d696d..58330bc84 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -10,6 +10,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; import java.util.Date; import java.util.List; @@ -17,7 +18,7 @@ import java.util.List; /** * Created by yixian on 2016-06-25. */ -@AutoMapper(tablename = "sys_clients", pkName = "client_id", pkAutoIncrement = true) +@AutoMapper(tablename = "sys_clients", pkName = "client_id", keyGenerator = Jdbc3KeyGenerator.class) public interface ClientMapper { @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "is_valid=1") diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.java index 3f245f99a..75b8a166a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.java @@ -5,6 +5,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; import com.alibaba.fastjson.JSONObject; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; import java.util.Date; import java.util.List; @@ -12,7 +13,7 @@ import java.util.List; /** * Created by davep on 2016-08-16. */ -@AutoMapper(tablename = "sys_client_rates", pkName = "client_rate_id", pkAutoIncrement = true) +@AutoMapper(tablename = "sys_client_rates", pkName = "client_rate_id", keyGenerator = Jdbc3KeyGenerator.class) public interface ClientRateMapper { List listCurrentClientRates(@Param("client_id") int clientId, @Param("date") Date date, @Param("rate_name") String rateName); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMapper.java index de8658aaf..fe417250c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMapper.java @@ -6,11 +6,12 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; import com.alibaba.fastjson.JSONObject; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; /** * Created by davep on 2016-08-03. */ -@AutoMapper(tablename = "sys_customer_relation", pkName = "relation_id", pkAutoIncrement = true) +@AutoMapper(tablename = "sys_customer_relation", pkName = "relation_id", keyGenerator = Jdbc3KeyGenerator.class) public interface CustomerMapper { @AutoSql(type = SqlType.INSERT) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/OrgMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/OrgMapper.java index a36a4fd4c..4b5b60f5c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/OrgMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/OrgMapper.java @@ -8,13 +8,14 @@ import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; import java.util.List; /** * Created by yixian on 2016-10-18. */ -@AutoMapper(tablename = "sys_org", pkName = "org_id", pkAutoIncrement = true) +@AutoMapper(tablename = "sys_org", pkName = "org_id", keyGenerator = Jdbc3KeyGenerator.class) public interface OrgMapper { @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "type != 1") diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionPartnerModuleMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionPartnerModuleMapper.java index 364c524d7..8382c9ee9 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionPartnerModuleMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/PermissionPartnerModuleMapper.java @@ -1,20 +1,18 @@ package au.com.royalpay.payment.manage.mappers.system; -import java.util.List; - -import org.apache.ibatis.annotations.Param; - -import com.alibaba.fastjson.JSONObject; - -import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect; import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; +import com.alibaba.fastjson.JSONObject; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; + +import java.util.List; /** * Created by yixian on 2017-02-28. */ -@AutoMapper(tablename = "sys_permission_partner_modules", pkName = "id",pkAutoIncrement = true) +@AutoMapper(tablename = "sys_permission_partner_modules", pkName = "id",keyGenerator = Jdbc3KeyGenerator.class) public interface PermissionPartnerModuleMapper { @AutoSql(type = SqlType.INSERT) void save(JSONObject module); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ReportConfigMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ReportConfigMapper.java index b7aaa896a..e650d3624 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ReportConfigMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ReportConfigMapper.java @@ -5,13 +5,14 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; import com.alibaba.fastjson.JSONObject; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; import java.util.List; /** * Created by yishuqian on 11/11/2016. */ -@AutoMapper(tablename = "austrac_report_config", pkName = "pkid", pkAutoIncrement = true) +@AutoMapper(tablename = "austrac_report_config", pkName = "pkid", keyGenerator = Jdbc3KeyGenerator.class) public interface ReportConfigMapper { @AutoSql(type = SqlType.UPDATE) void update(JSONObject jsonObject); 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 9d399d767..a7f248a71 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 @@ -16,7 +16,6 @@ import au.com.royalpay.payment.channels.yeepay.runtime.YeePayClient; import au.com.royalpay.payment.core.PaymentChannelApi; import au.com.royalpay.payment.core.exceptions.EmailException; import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; -import au.com.royalpay.payment.core.exceptions.ParamInvalidException; import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver; import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; @@ -25,28 +24,13 @@ import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; import au.com.royalpay.payment.manage.device.core.DeviceManager; import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl; import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper; -import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper; -import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper; -import au.com.royalpay.payment.manage.mappers.log.ClientsOperationLogMapper; -import au.com.royalpay.payment.manage.mappers.log.LogClientSubMerchantIdMapper; -import au.com.royalpay.payment.manage.mappers.log.LogSettleMailMapper; +import au.com.royalpay.payment.manage.mappers.log.*; import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper; import au.com.royalpay.payment.manage.mappers.risk.RiskAttentionMerchantsMapper; import au.com.royalpay.payment.manage.mappers.system.*; -import au.com.royalpay.payment.manage.merchants.beans.ActivityPosterBuilder; -import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; -import au.com.royalpay.payment.manage.merchants.beans.ClientRateConfig; -import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; -import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; -import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; -import au.com.royalpay.payment.manage.merchants.beans.SubMerchantIdApply; -import au.com.royalpay.payment.manage.merchants.core.ClientComplyValidator; -import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; -import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport; -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.beans.*; +import au.com.royalpay.payment.manage.merchants.core.*; import au.com.royalpay.payment.manage.merchants.entity.impls.*; import au.com.royalpay.payment.manage.notice.core.MailService; import au.com.royalpay.payment.manage.signin.beans.TodoNotice; @@ -72,7 +56,6 @@ import au.com.royalpay.payment.tools.inspiry.core.InspiryPOSFinder; import au.com.royalpay.payment.tools.locale.LocaleSupport; import au.com.royalpay.payment.tools.lock.Locker; import au.com.royalpay.payment.tools.mail.SendMail; -import org.apache.commons.codec.binary.Base64; import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO; import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; @@ -80,31 +63,24 @@ import au.com.royalpay.payment.tools.merchants.qrboard.QRBoard; import au.com.royalpay.payment.tools.merchants.qrboard.QRBoardProvider; import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.PartnerRole; -import au.com.royalpay.payment.tools.utils.ImageUtils; -import au.com.royalpay.payment.tools.utils.PageListUtils; -import au.com.royalpay.payment.tools.utils.PasswordUtils; -import au.com.royalpay.payment.tools.utils.PdfUtils; -import au.com.royalpay.payment.tools.utils.QRCodeUtils; -import au.com.royalpay.payment.tools.utils.TimeZoneUtils; +import au.com.royalpay.payment.tools.utils.*; import au.com.royalpay.payment.tools.websocket.notify.PartnerPageEvent; - +import cn.yixblog.platform.http.HttpRequestGenerator; +import cn.yixblog.platform.http.HttpRequestResult; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; 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 com.yeepay.yop.sdk.service.kj.model.SubmerchantRegisterResult; +import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.RandomUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateUtils; -import org.apache.el.parser.AstNot; -import org.apache.http.client.utils.URLEncodedUtils; import org.dom4j.Element; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -124,6 +100,13 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.thymeleaf.context.Context; import org.thymeleaf.spring4.SpringTemplateEngine; +import javax.annotation.PostConstruct; +import javax.annotation.Resource; +import javax.crypto.*; +import javax.crypto.spec.SecretKeySpec; +import javax.imageio.ImageIO; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; import java.awt.*; import java.awt.image.BufferedImage; import java.io.*; @@ -131,34 +114,18 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.net.URISyntaxException; import java.net.URL; -import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.security.InvalidKeyException; import java.security.InvalidParameterException; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; import java.util.List; +import java.util.*; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; -import javax.annotation.PostConstruct; -import javax.annotation.Resource; -import javax.crypto.*; -import javax.crypto.spec.DESKeySpec; -import javax.crypto.spec.IvParameterSpec; -import javax.crypto.spec.SecretKeySpec; -import javax.imageio.ImageIO; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; - -import cn.yixblog.platform.http.HttpRequestGenerator; -import cn.yixblog.platform.http.HttpRequestResult; -import sun.misc.BASE64Encoder; - import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission; /** @@ -5054,21 +5021,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid byte[] enCodeFormat = secretKey.getEncoded(); SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES"); Cipher cipher = Cipher.getInstance("AES"); - byte[] byteContent = content.getBytes("utf-8"); + byte[] byteContent = content.getBytes(StandardCharsets.UTF_8); cipher.init(Cipher.ENCRYPT_MODE, key); byte[] result = cipher.doFinal(byteContent); return Base64.encodeBase64String(result); - } catch (NoSuchPaddingException e) { - e.printStackTrace(); - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } catch (InvalidKeyException e) { - e.printStackTrace(); - } catch (IllegalBlockSizeException e) { - e.printStackTrace(); - } catch (BadPaddingException e) { + } catch (NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) { e.printStackTrace(); } return null; diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java index 407e709e3..d32a5c40a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java @@ -4,11 +4,7 @@ import au.com.royalpay.payment.core.exceptions.EmailException; import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.manage.device.core.DeviceManager; import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionManager; -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.ManagerMapper; -import au.com.royalpay.payment.manage.mappers.system.OrgMapper; -import au.com.royalpay.payment.manage.mappers.system.SysCustomerServiceMapper; +import au.com.royalpay.payment.manage.mappers.system.*; import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.notice.core.MailService; @@ -29,10 +25,7 @@ import au.com.royalpay.payment.tools.locale.LocaleSupport; import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; import au.com.royalpay.payment.tools.utils.PasswordUtils; - import com.alibaba.fastjson.JSONObject; - -import com.sun.xml.internal.bind.v2.TODO; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateUtils; @@ -44,19 +37,17 @@ import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; -import org.springframework.web.servlet.ModelAndView; import org.thymeleaf.context.Context; import org.thymeleaf.spring4.SpringTemplateEngine; +import javax.annotation.PostConstruct; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; -import javax.annotation.PostConstruct; -import javax.annotation.Resource; - /** * account service for sign in Created by yixian on 2016-06-29. */ 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 1f6968ad9..09abb821f 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 @@ -400,17 +400,50 @@ ifnull(sum(if(s.channel='Alipay'OR s.channel='AlipayOnline',s.orders,0)),0) alipay_order, ifnull(sum(if(s.channel='Wechat',s.total,0)),0) wechat_toatl, ifnull(sum(if(s.channel='Wechat',s.orders,0)),0) wechat_order - FROM statistics_customer_order s - RIGHT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1 + FROM sys_clients c + ]]> + LEFT JOIN ( + select ss.client_id,ss.channel,ss.orders,ss.total + from + statistics_customer_order ss + + and s.date >= #{begin} + and s.date < #{end} + + ) s ON c.client_id = s.client_id + + + INNER JOIN sys_client_bd d ON c.client_id = d.client_id AND d.bd_id = #{bd_user} and + date(d.start_date)<= #{begin} and (d.end_date is null or date(d.end_date)>= #{end}) and + d.is_valid=1 + + where c.is_valid=1 + + and c.org_id = #{org_id} + and c.state = #{state} + and c.org_id=#{org_id} + and c.org_id in + #{org_id} + + AND c.client_moniker IN + + #{client_moniker} + + + GROUP BY c.client_id ORDER BY total DESC + + + diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/OrderAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/OrderAnalysisMapper.xml index 650a06208..ada34a2a8 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/OrderAnalysisMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/OrderAnalysisMapper.xml @@ -234,6 +234,36 @@ GROUP BY o.customer_id + + SELECT * FROM pmt_transactions - WHERE client_id = #{client_id} AND clearing_amount > 1 + WHERE client_id = #{client_id} + AND clearing_amount > 1 ORDER BY transaction_time LIMIT 1; @@ -55,7 +56,8 @@ and l.org_id=#{org_id} and l.org_id in - #{org_id} + #{org_id} + @@ -274,7 +279,8 @@ and l.org_id=#{org_id} and l.org_id in - #{org_id} + #{org_id} + and l.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 @@ -311,7 +317,8 @@ and l.org_id=#{org_id} and l.org_id in - #{org_id} + #{org_id} + and l.org_id=#{org_id} and l.org_id in - #{org_id} + #{org_id} + @@ -693,8 +709,9 @@ and o.org_id=#{org_id} and o.org_id in - #{org_id} - GROUP BY date , channel ORDER BY date DESC + #{org_id} + + GROUP BY date , channel ORDER BY date DESC @@ -749,7 +767,8 @@ and o.channel=#{channel} and l.org_id=#{org_id} and l.org_id in - #{org_id} + #{org_id} + - select c.client_moniker,c.short_name,t.order_id,t.clearing_amount,t.transaction_time,t.channel,o.customer_id,o.customer_ip,o.gateway + select + c.client_moniker,c.short_name,t.order_id,t.clearing_amount,t.transaction_time,t.channel,o.customer_id,o.customer_ip,o.gateway FROM pmt_transactions t LEFT JOIN pmt_orders o on o.order_id=t.order_id INNER JOIN sys_clients c on c.client_id = t.client_id @@ -778,6 +798,19 @@ and t.clearing_amount >= #{amount_from} and t.clearing_amount < #{amount_to} + @@ -804,13 +837,13 @@ + + diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index d062bd58c..8322ad46d 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -273,13 +273,12 @@