diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java index 6b65c4dc0..34e102afd 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java @@ -401,7 +401,12 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format"); } params.put("channel",record.getString("channel")); - int newCustomers = transactionAnalysisMapper.countNewCustomers(params); + int newCustomers = 0; + if (client.getIntValue("client_id")==0){ + newCustomers = transactionAnalysisMapper.getCountCustomers(params.getDate("end")) - transactionAnalysisMapper.getCountCustomers(params.getDate("begin")); + }else { + newCustomers = transactionAnalysisMapper.countNewCustomers(params); + } int oldCustomers = transactionAnalysisMapper.countOldCustomers(params); record.put("new_customers",newCustomers); record.put("old_customers",oldCustomers); 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 7b959d673..3e83dc242 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 @@ -69,4 +69,6 @@ public interface TransactionAnalysisMapper { BigDecimal getOneOrder(@Param("order_id") String order_id); + int getCountCustomers(@Param("date") Date date); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/web/CustomerImpressionController.java b/src/main/java/au/com/royalpay/payment/manage/apps/web/CustomerImpressionController.java index 18469792a..b57203804 100644 --- a/src/main/java/au/com/royalpay/payment/manage/apps/web/CustomerImpressionController.java +++ b/src/main/java/au/com/royalpay/payment/manage/apps/web/CustomerImpressionController.java @@ -3,9 +3,11 @@ package au.com.royalpay.payment.manage.apps.web; import au.com.royalpay.payment.manage.apps.AppController; import au.com.royalpay.payment.manage.apps.bean.CustomerImpressionQuery; import au.com.royalpay.payment.manage.apps.core.CustomerImpression; +import au.com.royalpay.payment.tools.CommonConsts; import com.alibaba.fastjson.JSONObject; +import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -22,20 +24,21 @@ public class CustomerImpressionController { @RequestMapping(value = "/list", method = RequestMethod.GET) @ResponseBody - public JSONObject list(CustomerImpressionQuery customerImpressionQuery) { + public JSONObject list(CustomerImpressionQuery customerImpressionQuery,@ModelAttribute(CommonConsts.APP_INFO) JSONObject app) { + customerImpressionQuery.setClient_id(app.getInteger("client_id")); return customerImpression.listPageble(customerImpressionQuery); } - @RequestMapping(value = "/{client_id}/{customer_id}", method = RequestMethod.GET) + @RequestMapping(value = "/{customer_id}", method = RequestMethod.GET) @ResponseBody - public JSONObject find(@PathVariable int client_id,@PathVariable String customer_id) { - return customerImpression.findOne(client_id,customer_id); + public JSONObject find(@PathVariable String customer_id,@ModelAttribute(CommonConsts.APP_INFO) JSONObject app) { + return customerImpression.findOne(app.getIntValue("client_id"),customer_id); } - @RequestMapping(value = "/{client_id}/{customer_id}", method = RequestMethod.PUT) + @RequestMapping(value = "/{customer_id}", method = RequestMethod.PUT) @ResponseBody - public void modifyNameRemark(@PathVariable int client_id, @PathVariable String customer_id, @RequestBody JSONObject customerInfo) { - customerImpression.modifyNameRemark(client_id,customer_id,customerInfo.getString("name_remark")); + public void modifyNameRemark(@PathVariable String customer_id, @RequestBody JSONObject customerInfo,@ModelAttribute(CommonConsts.APP_INFO) JSONObject app) { + customerImpression.modifyNameRemark(app.getIntValue("client_id"),customer_id,customerInfo.getString("name_remark")); } } 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 3469b71ad..4a3f597ef 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 @@ -389,6 +389,12 @@ ]]> + SELECT - * + client_id,customer_id,name_remak,headimg,nick_name,tag,payment_times,total_amount,update_time,channel FROM sys_clients_customers where client_id = #{client_id} diff --git a/src/main/ui/static/templates/payment/success.js b/src/main/ui/static/templates/payment/success.js index 77a54636b..85c7020b3 100644 --- a/src/main/ui/static/templates/payment/success.js +++ b/src/main/ui/static/templates/payment/success.js @@ -1,10 +1,10 @@ -window.onbeforeunload = function(e) { +window.onbeforeunload = function (e) { return '页面已过期|Page Expired'; }; $(function () { var ctrl = {doubled: false, accessed: false}; $('.coin').click(function () { - if(ctrl.accessed && !ctrl.doubled){ + if (ctrl.accessed && !ctrl.doubled) { var coin = $(this); coin.addClass('throwing'); $.ajax({ @@ -15,20 +15,21 @@ $(function () { $('.encourage-dialog .money-amount').html(encourage.actural_amount); $('.encourage-dialog .double-rate').html('X ' + encourage.factor); $('.encourage-dialog .double-text').hide(); - setTimeout(function(){ + setTimeout(function () { coin.removeClass('throwing'); - },1000); + }, 1000); }, error: function () { - setTimeout(function(){ + setTimeout(function () { coin.removeClass('throwing'); - },1000); + }, 1000); } }); ctrl.doubled = true; } }); + function loadEncourage() { $.ajax({ url: '/act/encourage_money/orders/' + window.order_id, @@ -39,28 +40,32 @@ $(function () { $('.encourage-dialog .money-amount').html(encourage.actural_amount); $('.encourage-dialog .double-rate').html('X ' + encourage.factor); $('.encourage-dialog').removeClass('hide'); - ctrl.accessed=true; + ctrl.accessed = true; } } }) } + loadEncourage(); function loadPoints() { - $.ajax({ - url: '/customers/points/' + window.order_id +'/check', - method: 'GET', - dataType: 'text', - success: function (data) { - if (data>0){ - $('.points-dialog .points-value').html('+ ' + data); - $('.points-dialog').removeClass('hide'); - } + if ([0, 1, 2, 11].indexOf(window.order_gateway) >= 0) { + $.ajax({ + url: '/customers/points/' + window.order_id + '/check', + method: 'GET', + dataType: 'text', + success: function (data) { + if (data > 0) { + $('.points-dialog .points-value').html('+ ' + data); + $('.points-dialog').removeClass('hide'); + } - },error:function () { - } - }); + }, error: function () { + } + }); + } } + loadPoints(); $('.encourage-dialog .close-circle').click(function () {