diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index e0ac49378..2295275b3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -546,18 +546,18 @@ public class RetailAppServiceImp implements RetailAppService { PageList logs = clearingDetailMapper.listClientSettlementLog(params, new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit(), Order.formString("report_date.desc"))); logs.forEach(log -> log.put("total_charge", log.getBigDecimal("total_charge").add(log.getBigDecimal("tax_amount")))); - JSONObject result = PageListUtils.buildPageListResult(logs); if (appQueryBean.getPage() == 1) { if (!logs.isEmpty() && logs.size() > 0) { JSONObject sendMailLog = logSettleMailMapper.findByDate(logs.get(0).getDate("report_date")); if (sendMailLog == null) { - result.put("padding", true); - } - if (sendMailLog != null && sendMailLog.getIntValue("mail_status") != 1) { - result.put("padding", true); + logs.remove(0); + }else if (sendMailLog != null && sendMailLog.getIntValue("mail_status") != 1) { + logs.remove(0); } } } + JSONObject result = PageListUtils.buildPageListResult(logs); + return result; } diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/beans/ConfigOperationQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/logview/beans/ConfigOperationQueryBean.java new file mode 100644 index 000000000..7911de836 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/logview/beans/ConfigOperationQueryBean.java @@ -0,0 +1,89 @@ +package au.com.royalpay.payment.manage.logview.beans; + +import au.com.royalpay.payment.core.exceptions.ParamInvalidException; + +import com.alibaba.fastjson.JSONObject; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.time.DateUtils; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.TimeZone; + +/** + * Created by yixian on 2016-10-18. + */ +public class ConfigOperationQueryBean { + private static final String[] pattern = {"yyyyMMdd"}; + private String begin; + private String end; + private int page = 1; + private int limit = 20; + private String client_moniker; + + public JSONObject toJSON() { + SimpleDateFormat utcFormater = new SimpleDateFormat("yyyyMMdd"); + utcFormater.setTimeZone(TimeZone.getTimeZone("UTC"));//时区定义并进行时间获取 + JSONObject res = new JSONObject(); + if (begin != null) { + try { + + res.put("begin", utcFormater.parse(begin)); + } catch (ParseException e) { + throw new ParamInvalidException("begin", "error.payment.valid.invalid_time"); + } + } + if (end != null) { + try { + res.put("end", DateUtils.addDays(utcFormater.parse(end),1)); + } catch (ParseException e) { + throw new ParamInvalidException("end", "error.payment.valid.invalid_time"); + } + } + if(StringUtils.isNotEmpty(this.client_moniker)){ + res.put("client_moniker",this.client_moniker); + } + return res; + } + + public String getBegin() { + return begin; + } + + public void setBegin(String begin) { + this.begin = begin; + } + + public String getEnd() { + return end; + } + + public void setEnd(String end) { + this.end = end; + } + + public int getPage() { + return page; + } + + public void setPage(int page) { + this.page = page; + } + + public int getLimit() { + return limit; + } + + public void setLimit(int limit) { + this.limit = limit; + } + + public String getClient_moniker() { + return client_moniker; + } + + public void setClient_moniker(String client_moniker) { + this.client_moniker = client_moniker; + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/OperationLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/OperationLogServiceImpl.java index 40bd74e2b..0528e18c8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/OperationLogServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/logview/core/impl/OperationLogServiceImpl.java @@ -9,6 +9,8 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.Paginator; import org.apache.commons.lang3.StringUtils; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; @@ -38,9 +40,12 @@ public class OperationLogServiceImpl implements OperationLogService { } } Query query = new Query(); + query.with(new Sort(new Sort.Order(Sort.Direction.DESC,"createTime"))); if (params.getIntValue("client_id") != 0) { query.addCriteria(Criteria.where("clientId").is(params.getIntValue("client_id"))); } + query.with(new PageRequest(pageBounds.getPage()-1, pageBounds.getLimit())); + query.addCriteria(Criteria.where("createTime").gt((params.getDate("begin"))).lt(params.getDate("end"))); List clientConfigLogList = mongoTemplate.find(query, ClientConfigLog.class); return buildPageListResult(clientConfigLogList, new Paginator(pageBounds.getPage(), pageBounds.getLimit(), (int) mongoTemplate.count(query, ClientConfigLog.class))); diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/web/ConfigOperationController.java b/src/main/java/au/com/royalpay/payment/manage/logview/web/ConfigOperationController.java index 3eea7c28d..694374aab 100644 --- a/src/main/java/au/com/royalpay/payment/manage/logview/web/ConfigOperationController.java +++ b/src/main/java/au/com/royalpay/payment/manage/logview/web/ConfigOperationController.java @@ -1,5 +1,6 @@ package au.com.royalpay.payment.manage.logview.web; +import au.com.royalpay.payment.manage.logview.beans.ConfigOperationQueryBean; import au.com.royalpay.payment.manage.logview.core.OperationLogService; import com.alibaba.fastjson.JSONObject; @@ -7,7 +8,6 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; @@ -22,9 +22,7 @@ public class ConfigOperationController { private OperationLogService operationLogService; @RequestMapping(method = RequestMethod.GET) - public JSONObject list(@RequestParam(required = false) String client_moniker,@RequestParam(defaultValue = "1") int page,@RequestParam(defaultValue = "10") int limit){ - JSONObject params = new JSONObject(); - params.put("client_moniker",client_moniker); - return operationLogService.query(params,new PageBounds(page,limit)); + public JSONObject list(ConfigOperationQueryBean configOperationQueryBean){ + return operationLogService.query(configOperationQueryBean.toJSON(),new PageBounds(configOperationQueryBean.getPage(),configOperationQueryBean.getLimit())); } } 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 32771d85a..044205045 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 @@ -2647,18 +2647,17 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid params.put("client_id", client_id); PageList logs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc"))); - JSONObject result = PageListUtils.buildPageListResult(logs); if (query.getPage() == 1) { if (!logs.isEmpty() && logs.size() > 0) { JSONObject sendMailLog = logSettleMailMapper.findByDate(logs.get(0).getDate("clearing_time")); if (sendMailLog == null) { - result.put("padding", true); - } - if (sendMailLog != null && sendMailLog.getIntValue("mail_status") != 1) { - result.put("padding", true); + logs.remove(0); + }else if (sendMailLog != null && sendMailLog.getIntValue("mail_status") != 1) { + logs.remove(0); } } } + JSONObject result = PageListUtils.buildPageListResult(logs); return result; } diff --git a/src/main/ui/static/config/logview/logview.js b/src/main/ui/static/config/logview/logview.js index cf5a1a0da..ec7a739ec 100644 --- a/src/main/ui/static/config/logview/logview.js +++ b/src/main/ui/static/config/logview/logview.js @@ -117,11 +117,17 @@ define(['angular', 'uiRouter'], function (angular) { app.controller('configOperationLogCtrl', ['$scope', '$http', '$filter', function ($scope, $http, $filter) { $scope.pagination = {}; - $scope.params = {}; + $scope.params = {begin:new Date().setDate(new Date().getDate()-1),end:new Date()}; $scope.listConfiglogs = function (page) { var params = angular.copy($scope.params) || {}; params.page = page || $scope.pagination.page || 1; - params.date = $filter('date')(params.date, 'yyyyMMdd'); + if (params.begin != null) { + params.begin = $filter('date')(params.begin, 'yyyyMMdd'); + } + if (params.end != null) { + params.end = $filter('date')(params.end, 'yyyyMMdd'); + } + params.page = page || $scope.pagination.page || 1; $http.get('/sys_logs/config/operation', {params: params}).then(function (resp) { $scope.logs = resp.data.data; $scope.pagination = resp.data.pagination; diff --git a/src/main/ui/static/config/logview/templates/config_opertaion_log.html b/src/main/ui/static/config/logview/templates/config_opertaion_log.html index 9c45e5586..4d8eeaf6b 100644 --- a/src/main/ui/static/config/logview/templates/config_opertaion_log.html +++ b/src/main/ui/static/config/logview/templates/config_opertaion_log.html @@ -1,3 +1,17 @@ +
+

Config Operation Logs

+ +
+ +
@@ -5,13 +19,28 @@
-
-
- +
+
+
@@ -36,6 +65,7 @@
business
+ - \ No newline at end of file + +
\ No newline at end of file diff --git a/src/main/ui/static/config/logview/templates/root.html b/src/main/ui/static/config/logview/templates/root.html index ffa305c3f..dfb9fd06a 100644 --- a/src/main/ui/static/config/logview/templates/root.html +++ b/src/main/ui/static/config/logview/templates/root.html @@ -24,7 +24,7 @@ WeChat Messages - + Config Operation diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 2153f9788..e786332b4 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -1484,6 +1484,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }]); app.controller('partnerRatesCtrl', ['$scope', '$rootScope', '$http', '$uibModal', 'commonDialog', function ($scope, $rootScope, $http, $uibModal, commonDialog) { $scope.bankCtrl = {edit: true, rate_name: 'Wechat'}; + $scope.init = {skip_clearing:false,tax_in_surcharge:false,customer_tax_free:false}; $scope.getBankAccount = function () { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/bank_account').then(function (resp) { $scope.bankaccount = resp.data; @@ -1501,17 +1502,30 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }); }; $scope.skipClearing = function (skipClearing) { + if (!$scope.init.skip_clearing) { + $scope.init.skip_clearing = true; + return; + } $http.put('/sys/partners/' + $scope.partner.client_moniker + '/skip_clearing', {skip_clearing: skipClearing}).then(function (resp) { + $scope.getBankAccount(); }); }; $scope.taxInSurcharge = function (taxInSurcharge) { + if (!$scope.init.tax_in_surcharge) { + $scope.init.tax_in_surcharge = true; + return; + } $http.put('/sys/partners/' + $scope.partner.client_moniker + '/tax_in_surcharge', {tax_in_surcharge: taxInSurcharge}).then(function (resp) { - + $scope.getBankAccount(); }) }; $scope.customerTaxFree = function (customerTaxFree) { + if (!$scope.init.customer_tax_free) { + $scope.init.customer_tax_free = true; + return; + } $http.put('/sys/partners/' + $scope.partner.client_moniker + '/customer_tax_free', {customer_tax_free: customerTaxFree}).then(function (resp) { - + $scope.getBankAccount(); }) }; $scope.settleHours = [{value: undefined, label: 'Default(24:00, GMT+10)'}]; diff --git a/src/main/ui/static/payment/partner/templates/partner_detail.html b/src/main/ui/static/payment/partner/templates/partner_detail.html index c12623b57..3fc473afc 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -32,11 +32,6 @@ height: 100px; margin-left: 20px; } - .star_position{ - position: absolute; - right: 0px; - top: -1px; - }

@@ -520,12 +515,7 @@
- +

@@ -534,6 +524,10 @@ ng-click="resendApproveEmail()"> Resend Email + + + +

diff --git a/src/main/ui/static/payment/partner/templates/partner_payment_info.html b/src/main/ui/static/payment/partner/templates/partner_payment_info.html index 4ef0ef886..2fdc8b945 100644 --- a/src/main/ui/static/payment/partner/templates/partner_payment_info.html +++ b/src/main/ui/static/payment/partner/templates/partner_payment_info.html @@ -279,7 +279,7 @@
- +