diff --git a/src/db/modify.sql b/src/db/modify.sql index a6db278f9..7328ed984 100644 --- a/src/db/modify.sql +++ b/src/db/modify.sql @@ -58,7 +58,7 @@ ALTER TABLE `log_manager_login` MODIFY COLUMN `manager_id` varchar(50) NOT NULL AFTER `id`; ALTER TABLE `financial_bd_commission_config` - MODIFY COLUMN `bd_id` varchar(50) NOT NULL DEFAULT 0 COMMENT 'bd id' AFTER `bd_name`; + MODIFY COLUMN `bd_id` varchar(50) NOT NULL DEFAULT 0 COMMENT 'bd id'; ALTER TABLE `financial_bd_config` MODIFY COLUMN `bd_group` varchar(50) NULL DEFAULT NULL COMMENT 'BD Leader manger_id' AFTER `get_prize`; diff --git a/src/main/java/au/com/royalpay/payment/manage/task/CheckPartnerAuthStatusAndSendMessageTask.java b/src/main/java/au/com/royalpay/payment/manage/task/CheckPartnerAuthStatusAndSendMessageTask.java index 5ffffa1b8..d8b18c490 100644 --- a/src/main/java/au/com/royalpay/payment/manage/task/CheckPartnerAuthStatusAndSendMessageTask.java +++ b/src/main/java/au/com/royalpay/payment/manage/task/CheckPartnerAuthStatusAndSendMessageTask.java @@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.task; import au.com.royalpay.payment.manage.application.core.SimpleClientService; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -11,6 +12,7 @@ import javax.annotation.Resource; * Created by yishuqian on 12/03/2017. */ @Component +@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") public class CheckPartnerAuthStatusAndSendMessageTask { @Resource private SimpleClientService simpleClientService; diff --git a/src/main/java/au/com/royalpay/payment/manage/task/DailyReportGenerationTask.java b/src/main/java/au/com/royalpay/payment/manage/task/DailyReportGenerationTask.java index fba6d04bb..310e266b4 100644 --- a/src/main/java/au/com/royalpay/payment/manage/task/DailyReportGenerationTask.java +++ b/src/main/java/au/com/royalpay/payment/manage/task/DailyReportGenerationTask.java @@ -4,6 +4,7 @@ import au.com.royalpay.payment.manage.analysis.core.DailyReport; import org.apache.commons.lang.time.DateFormatUtils; import org.apache.commons.lang.time.DateUtils; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -15,6 +16,7 @@ import javax.annotation.Resource; * Created by yixian on 2017-03-07. */ @Component +@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") public class DailyReportGenerationTask { @Resource diff --git a/src/main/java/au/com/royalpay/payment/manage/task/DashboardTaskManager.java b/src/main/java/au/com/royalpay/payment/manage/task/DashboardTaskManager.java index ef2da42f6..572a5a142 100644 --- a/src/main/java/au/com/royalpay/payment/manage/task/DashboardTaskManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/task/DashboardTaskManager.java @@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.task; import au.com.royalpay.payment.manage.analysis.core.DashboardService; import org.apache.commons.lang.time.DateUtils; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -14,6 +15,7 @@ import javax.annotation.Resource; * Created by yixian on 2016-11-14. */ @Component +@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") public class DashboardTaskManager { @Resource private DashboardService dashboardService; diff --git a/src/main/java/au/com/royalpay/payment/manage/task/PartnerTransactionsDailyMsgTaskManager.java b/src/main/java/au/com/royalpay/payment/manage/task/PartnerTransactionsDailyMsgTaskManager.java index 9bc4d5b90..b41cd6e6a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/task/PartnerTransactionsDailyMsgTaskManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/task/PartnerTransactionsDailyMsgTaskManager.java @@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.task; import au.com.royalpay.payment.manage.analysis.core.CustomersAnalysisService; import org.apache.commons.lang.time.DateUtils; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -14,6 +15,7 @@ import javax.annotation.Resource; * Created by yixian on 2016-11-14. */ @Component +@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") public class PartnerTransactionsDailyMsgTaskManager { @Resource private CustomersAnalysisService customersAnalysisService; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index c17a03221..ca4a94378 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -75,7 +75,7 @@ app.settlement.email-cc=leo.huang@royalpay.com.au app.mpsupport.appid=royalpay app.mpsupport.auth_code=W3xucYnbmbE6rZDmA2V9BsKmagTrVIny -app.run-tasks=false +app.run-tasks=true app.allow-clearing-generation=false app.mail.appid=1 diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml index 33d18537a..3469b71ad 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml @@ -188,6 +188,8 @@ THEN 'Third Party Gateway' WHEN 10 THEN 'APP' + WHEN 11 + THEN 'Share Code' END AS gateway_label, ifnull(sum(if(l.transaction_type='Credit',l.clearing_amount,-l.clearing_amount)), 0) aud_fee FROM pmt_transactions l @@ -414,6 +416,8 @@ THEN 'Third Party Gateway' WHEN 10 THEN 'APP' + WHEN 11 + THEN 'Share Code' END AS gateway_label, ifnull(COUNT(DISTINCT l.client_id), 0) partner_count FROM pmt_transactions l @@ -462,10 +466,12 @@ and o.gateway=9 - and o.gateway=10 + + and o.gateway=11 + and l.org_id=#{org_id} and l.client_id in (SELECT b.client_id FROM sys_client_bd b @@ -543,6 +549,9 @@ and o.gateway=10 + + and o.gateway=11 + and ptran.org_id=#{org_id}