Merge remote-tracking branch 'origin/master'

master
eason 6 years ago
commit efd759c3f7

@ -546,18 +546,18 @@ public class RetailAppServiceImp implements RetailAppService {
PageList<JSONObject> 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;
}

@ -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;
}
}

@ -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<ClientConfigLog> clientConfigLogList = mongoTemplate.find(query, ClientConfigLog.class);
return buildPageListResult(clientConfigLogList,
new Paginator(pageBounds.getPage(), pageBounds.getLimit(), (int) mongoTemplate.count(query, ClientConfigLog.class)));

@ -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()));
}
}

@ -2647,18 +2647,17 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
params.put("client_id", client_id);
PageList<JSONObject> 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;
}

@ -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;

@ -1,3 +1,17 @@
<section class="content-header">
<h1>Config Operation Logs</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-file-text-o"></i> Basic Config
</li>
<li>
<a ui-sref="^">Log Views</a>
</li>
<li class="active">Config Operation Logs</li>
</ol>
</section>
<section class="content">
<div class="panel panel-default">
<div class="panel-heading">
<div class="form-inline">
@ -5,13 +19,28 @@
<label class="control-label" for="moniker-input">Client Moniker</label>
<input class="form-control" size="5" id="moniker-input" ng-model="params.client_moniker" ng-enter="listConfiglogs(1)">
</div>
<button class="btn btn-success" type="button" ng-click="listClientLoginLogs(1)">
<div class="form-group">
<label class="control-label" for="date-from-input">From</label>
<input class="form-control" id="date-from-input" ng-model="params.begin"
uib-datepicker-popup size="10" placeholder="From"
is-open="dateBegin.open" ng-click="dateBegin.open=true"
datepicker-options="{maxDate:params.end||today}">
</div>
<div class="form-group">
<label class="control-label" for="date-to-input">To</label>
<input class="form-control" id="date-to-input" ng-model="params.end"
uib-datepicker-popup size="10" placeholder="To"
is-open="dateEnd.open" ng-click="dateEnd.open=true"
datepicker-options="{minDate:params.begin,maxDate:today}">
</div>
<button class="btn btn-success" type="button" ng-click="listConfiglogs(1)">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
<div class="table-responsive">
<table class="table table-bordered table-hover table-striped">
<div class="panel panel-default">
<div class="panel-body table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>business</th>
@ -36,6 +65,7 @@
</tbody>
</table>
</div>
</div>
<div class="panel-footer" ng-if="pagination.totalPages>1">
<uib-pagination class="pagination"
total-items="pagination.totalCount"
@ -52,4 +82,5 @@
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
</div>
</div>
</div>
</div>
</section>

@ -24,7 +24,7 @@
WeChat Messages
</a>
<a class="btn btn-app" role="button" ui-sref=".config_operation">
<i class="fa fa-weixin"></i>
<i class="fa fa-edit"></i>
Config Operation
</a>
</div>

@ -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)'}];

@ -32,11 +32,6 @@
height: 100px;
margin-left: 20px;
}
.star_position{
position: absolute;
right: 0px;
top: -1px;
}
</style>
<section class="content-header">
<h1>
@ -520,12 +515,7 @@
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">E-mail
<span ng-if="('10'|withRole)">
<i style="cursor: pointer" ng-click="addSub()" ng-if="!partner.unsubscribe" class="fa fa-star text-yellow star_position"></i>
<i style="cursor: pointer" ng-click="removeSub()" ng-if="partner.unsubscribe" class="fa fa-star-o text-yellow star_position"></i>
</span>
</label>
<label class="control-label col-sm-4">E-mail</label>
<div class="col-sm-8">
<p class="form-control-static">
@ -534,6 +524,10 @@
ng-click="resendApproveEmail()">
<i class="fa fa-envelope"></i> Resend Email
</a>
<span ng-if="('10'|withRole)">
<i style="cursor: pointer" ng-click="addSub()" ng-if="!partner.unsubscribe" class="fa fa-star text-yellow"></i>
<i style="cursor: pointer" ng-click="removeSub()" ng-if="partner.unsubscribe" class="fa fa-star-o text-yellow"></i>
</span>
</p>
</div>
</div>

@ -279,7 +279,7 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Enable Alipay Online</label>
<label class="col-sm-2 control-label">Use Alipay Online</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.gateway_alipay_online" bs-switch switch-change="toggleGatewayAlipayOnline()">
</div>

Loading…
Cancel
Save