commit
e5dc84fa50
@ -0,0 +1,20 @@
|
|||||||
|
package au.com.royalpay.payment.manage.logview.core;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.merchants.beans.mongo.ClientConfigLog;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kira
|
||||||
|
* @date 2018/6/15
|
||||||
|
*/
|
||||||
|
public interface OperationLogService {
|
||||||
|
|
||||||
|
List<ClientConfigLog> query(JSONObject params);
|
||||||
|
|
||||||
|
JSONObject query(JSONObject params, PageBounds pageBounds);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package au.com.royalpay.payment.manage.logview.core.impl;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.logview.core.OperationLogService;
|
||||||
|
import au.com.royalpay.payment.manage.merchants.beans.mongo.ClientConfigLog;
|
||||||
|
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
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.mongodb.core.MongoTemplate;
|
||||||
|
import org.springframework.data.mongodb.core.query.Criteria;
|
||||||
|
import org.springframework.data.mongodb.core.query.Query;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kira
|
||||||
|
* @date 2018/6/15
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OperationLogServiceImpl implements OperationLogService {
|
||||||
|
@Resource
|
||||||
|
private MongoTemplate mongoTemplate;
|
||||||
|
@Resource
|
||||||
|
private ClientManager clientManager;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject query(JSONObject params, PageBounds pageBounds) {
|
||||||
|
if (StringUtils.isNotEmpty(params.getString("client_moniker"))) {
|
||||||
|
JSONObject client = clientManager.getClientInfoByMoniker(params.getString("client_moniker"));
|
||||||
|
if(client!=null) {
|
||||||
|
params.put("client_id", client.getIntValue("client_id"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Query query = new Query();
|
||||||
|
if (params.getIntValue("client_id") != 0) {
|
||||||
|
query.addCriteria(Criteria.where("clientId").is(params.getIntValue("client_id")));
|
||||||
|
}
|
||||||
|
List<ClientConfigLog> clientConfigLogList = mongoTemplate.find(query, ClientConfigLog.class);
|
||||||
|
return buildPageListResult(clientConfigLogList,
|
||||||
|
new Paginator(pageBounds.getPage(), pageBounds.getLimit(), (int) mongoTemplate.count(query, ClientConfigLog.class)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ClientConfigLog> query(JSONObject params) {
|
||||||
|
Query query = new Query();
|
||||||
|
query.addCriteria(Criteria.where("clientId").is(params.getIntValue("client_id")));
|
||||||
|
List<ClientConfigLog> clientConfigLogList = mongoTemplate.find(query, ClientConfigLog.class);
|
||||||
|
Paginator paginator = new Paginator(1, 1, 1);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JSONObject buildPageListResult(List datas, Paginator paginator) {
|
||||||
|
JSONObject res = new JSONObject();
|
||||||
|
res.put("data", datas);
|
||||||
|
res.put("pagination", paginator);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package au.com.royalpay.payment.manage.logview.web;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.logview.core.OperationLogService;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Tayl0r on 2017/5/3.
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "/sys_logs/config/operation")
|
||||||
|
public class ConfigOperationController {
|
||||||
|
@Resource
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<div class="form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<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)">
|
||||||
|
<i class="fa fa-search"></i> Search
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-bordered table-hover table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>business</th>
|
||||||
|
<th>createTime</th>
|
||||||
|
<th>newData</th>
|
||||||
|
<th>originData</th>
|
||||||
|
<th>userId</th>
|
||||||
|
<th>userName</th>
|
||||||
|
<th>userType</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="log in logs">
|
||||||
|
<td ng-bind="log.business"></td>
|
||||||
|
<td ng-bind="log.createTime"></td>
|
||||||
|
<td ng-bind="log.newData"></td>
|
||||||
|
<td ng-bind="log.originData"></td>
|
||||||
|
<td ng-bind="log.userId"></td>
|
||||||
|
<td ng-bind="log.userName"></td>
|
||||||
|
<td ng-bind="log.userType"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="panel-footer" ng-if="pagination.totalPages>1">
|
||||||
|
<uib-pagination class="pagination"
|
||||||
|
total-items="pagination.totalCount"
|
||||||
|
boundary-links="true"
|
||||||
|
ng-model="pagination.page"
|
||||||
|
items-per-page="pagination.limit"
|
||||||
|
max-size="10"
|
||||||
|
ng-change="listConfiglogs()"
|
||||||
|
previous-text="‹"
|
||||||
|
next-text="›"
|
||||||
|
first-text="«"
|
||||||
|
last-text="»"></uib-pagination>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
|
||||||
|
<div class="content" style="min-height: 100px">
|
||||||
|
<div class="form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<input class="form-control" placeholder="Client Moniker" ng-model="params.client_moniker">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<button class="btn btn-success pull-right" ng-click="save()">Add</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,82 @@
|
|||||||
|
<section class="content-header">
|
||||||
|
<h1>Mail Not Subscribe</h1>
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li>
|
||||||
|
<a ui-sref="^"><i class="fa fa-cog"></i> System Config</a>
|
||||||
|
</li>
|
||||||
|
<li>Mail Not Subscribe</li>
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
<div class="content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="box-solid">
|
||||||
|
<div class="box box-warning">
|
||||||
|
<div class="box-header">
|
||||||
|
<div class="form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<input class="form-control" placeholder="Client Moniker" ng-model="params.client_moniker">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<input class="form-control" placeholder="Mail Address" ng-model="params.address">
|
||||||
|
</div>
|
||||||
|
<button class="btn btn-success" ng-click="loadUnSubs(1)"><i
|
||||||
|
class="fa fa-search"></i> Search</button>
|
||||||
|
<button class="btn btn-success pull-right" ng-click="addUnSub()" ng-click="addUnSubs()">Add</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-header">
|
||||||
|
<h3 class="box-title">Not Subscribed List</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="box-body no-padding table-responsive">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Partner Code</th>
|
||||||
|
<th>Client Id</th>
|
||||||
|
<th>Mail Address</th>
|
||||||
|
<th>Create Time</th>
|
||||||
|
<th>Operation</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="subscribe in mailSubscribes">
|
||||||
|
<td ng-bind="subscribe.client_moniker"></td>
|
||||||
|
<td ng-bind="subscribe.client_id"></td>
|
||||||
|
<td ng-bind="subscribe.address"></td>
|
||||||
|
<td ng-bind="subscribe.create_time"></td>
|
||||||
|
<td>
|
||||||
|
<a class="text-primary" role="button" title="delete">
|
||||||
|
<i class="glyphicon glyphicon-trash" ng-click="deleteSub(subscribe.id)"></i>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="box-footer" ng-if="mailSubscribes.length">
|
||||||
|
<uib-pagination class="pagination"
|
||||||
|
total-items="pagination.totalCount"
|
||||||
|
boundary-links="true"
|
||||||
|
ng-model="pagination.page"
|
||||||
|
items-per-page="pagination.limit"
|
||||||
|
max-size="10"
|
||||||
|
ng-change="loadUnSubs()"
|
||||||
|
previous-text="‹"
|
||||||
|
next-text="›"
|
||||||
|
first-text="«"
|
||||||
|
last-text="»"></uib-pagination>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total
|
||||||
|
Pages:{{pagination.totalPages}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
Loading…
Reference in new issue