master
kira 6 years ago
commit 23347b58cd

@ -18,7 +18,7 @@ import java.util.List;
@AutoMapper(tablename = "pmt_sub_merchant_id", pkName = "sub_merchant_id")
public interface CommonSubMerchantIdMapper {
@AutoSql(type = SqlType.SELECT)
List<JSONObject> list(@Param("is_valid") boolean is_valid, @Param("sub_merchant_id") String sub_merchant_id,PageBounds pageBounds);
PageList<JSONObject> list(@Param("is_valid") boolean is_valid, @Param("sub_merchant_id") String sub_merchant_id,PageBounds pageBounds);
@AutoSql(type = SqlType.INSERT)
void save(JSONObject record);

@ -6,9 +6,12 @@ import au.com.royalpay.payment.manage.merchantid.core.MerchantIdManageService;
import au.com.royalpay.payment.manage.permission.manager.RequireManager;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -54,8 +57,10 @@ public class MerchantIdManageController {
@RequestMapping(value = "/common_sub_merchant_id", method = RequestMethod.GET)
@RequireManager(role = {ManagerRole.OPERATOR})
public List<JSONObject> listCommonSubMerchantId(@RequestParam(required = false) String sub_merchant_id, @RequestParam(defaultValue = "true") boolean is_valid) {
return commonSubMerchantIdMapper.list(is_valid,sub_merchant_id,new PageBounds(Order.formString("create_time.desc")));
public JSONObject listCommonSubMerchantId(@RequestParam(required = false) String sub_merchant_id,
@RequestParam int page, @RequestParam(defaultValue = "true") boolean is_valid) {
PageList<JSONObject> list = commonSubMerchantIdMapper.list(is_valid,sub_merchant_id,new PageBounds(page, 20, Order.formString("create_time.desc")));
return PageListUtils.buildPageListResult(list);
}
@RequestMapping(value = "/common_sub_merchant_id/{sub_merchant_id}", method = RequestMethod.POST)

@ -30,7 +30,7 @@ public interface RiskMerchantService {
JSONObject listAttentionMerchants(JSONObject manager, QueryAttentionMerchants queryAttention);
void addAttentionMerchant(JSONObject manager, String clientMoniker);
void addAttentionMerchant(JSONObject manager, String clientMoniker, JSONObject params);
void disableAttentionMerchant(JSONObject manager, String clientMoniker);
}

@ -224,7 +224,7 @@ public class RiskMerchantServiceImpl implements RiskMerchantService {
}
@Override
public void addAttentionMerchant(JSONObject manager, String clientMoniker) {
public void addAttentionMerchant(JSONObject manager, String clientMoniker, JSONObject params) {
if (manager == null) {
throw new BadRequestException("登录状态已过期,请清新登录再试");
}
@ -243,8 +243,9 @@ public class RiskMerchantServiceImpl implements RiskMerchantService {
attention.put("contact_phone", client.getString("contact_phone"));
attention.put("bank_account_no", bankAccount == null || bankAccount.size() <= 0 ? "" : bankAccount.get(0).getString("account_no"));
attention.put("is_valid", 1);
attention.put("creation_date", new Date());
attention.put("creation_date", params.getDate("creation_date")==null ? new Date() : params.getDate("creation_date"));
attention.put("creation_by", manager.getString("manager_id"));
attention.put("remark", params.getString("remark"));
attention.put("last_update_date", new Date());
attention.put("last_update_by", manager.getString("manager_id"));

@ -96,8 +96,8 @@ public class RiskController {
}
@RequestMapping(value = "/attention/{clientMoniker}", method = RequestMethod.POST)
public void addMerchant(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) {
riskMerchantService.addAttentionMerchant(manager, clientMoniker);
public void addMerchant(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject params) {
riskMerchantService.addAttentionMerchant(manager, clientMoniker, params);
}
@RequestMapping(value = "/attention/{clientMoniker}", method = RequestMethod.PUT)

@ -81,16 +81,18 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.pagination = {};
$scope.params = {};
$scope.loadTempSubMerchantId = function () {
var params = angular.copy($scope.params);
$scope.loadTempSubMerchantId = function (page) {
var params = angular.copy($scope.params) || {};
params.page = page || $scope.pagination.page || 1;
if(!params.sub_merchant_id){
delete params.sub_merchant_id;
}
$http.get('/sys/merchant_id/common_sub_merchant_id',{params: params}).then(function (resp) {
$scope.subMerchantIdList= resp.data;
$scope.subMerchantIdList= resp.data.data;
$scope.pagination = resp.data.pagination;
});
};
$scope.loadTempSubMerchantId();
$scope.loadTempSubMerchantId(1);
$scope.save = function () {
$uibModal.open({
templateUrl: '/static/payment/merchantid/templates/new_common_sub_merchant_id.html',

@ -1,11 +1,23 @@
<div class="row">
<div class="box-body table-responsive">
<div class="col-sm-12 col-xs-6">
<a role="button" class="btn btn-primary pull-right" title="Add Sub Merchant Id"
ng-click="save()">
<i class="fa fa-plus"></i>
Add
</a>
<div class="form-group">
<div class="col-xs-4 col-sm-6" style="text-align: left">
<a role="button" class="btn btn-primary" title="Add Sub Merchant Id"
ng-click="save()">
<i class="fa fa-plus"></i>
Add
</a>
</div>
<div class="col-sm-6" style="text-align: right">
<div class="col-xs-4 col-sm-8">
<input class="form-control" placeholder="Sub Merchant Id" ng-model="params.sub_merchant_id" ng-enter="loadTempSubMerchantId(1)">
</div>
<div class="col-xs-4 col-sm-1">
<button class="btn btn-success" type="button" ng-click="loadTempSubMerchantId(1)">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
</div>
<table class="table table-striped">
<thead>
@ -35,4 +47,20 @@
</tbody>
</table>
</div>
<div class="panel-footer" ng-if="subMerchantIdList.length > 0">
<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="loadTempSubMerchantId()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
</div>
</div>
</div>

@ -514,7 +514,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
$scope.decideCompliance = function (name) {
var keywords = ['education','financial' ,'train','immigrant','invest',
'律师咨询','会计事务所','移民留学','娱乐','金融','地产','投资'];
'律师咨询','会计事务所', '移民', '留学','娱乐','金融','地产','投资'];
for(var i = 0; i < keywords.length; i++){
if (name.indexOf(keywords[i]) != -1) {
return true;
@ -1363,7 +1363,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
var info = [];
$scope.decideCompliance = function (name) {
var keywords = ['education','financial' ,'train','immigrant','invest',
'律师咨询','会计事务所','移民留学','娱乐','金融','地产','投资'];
'律师咨询','会计事务所', '移民', '留学','娱乐','金融','地产','投资'];
for(var i = 0; i < keywords.length; i++){
if (name.indexOf(keywords[i]) != -1) {
return true;

@ -233,7 +233,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$http.get('/sys/risk/attention', {params: params}).then(function (resp) {
$scope.attentions = resp.data.data;
$scope.pagination = resp.data.pagination;
$scope.ctrl.addAttention = false;
// $scope.ctrl.addAttention = false;
});
};
$scope.loadAttentionMerchants(1);
@ -255,7 +255,26 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
});
}
};
$scope.addAttention = function () {
$uibModal.open({
templateUrl: '/static/risk/templates/risk_add.html',
controller: 'newRiskCtrl'
}).result.then(function () {
$scope.loadAttentionMerchants(1);
})
};
}]);
app.controller('newRiskCtrl', ['$scope', '$http','commonDialog', function ($scope, $http,commonDialog) {
$scope.save = function (attentions) {
var params = angular.copy(attentions);
$http.post('/sys/risk/attention/'+ attentions.client_moniker, params).then(function () {
commonDialog.alert({title: 'Success', content: 'add successfully', type: 'success'});
$scope.$close();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
});
};
}]);
app.filter('risk_type', function () {
return function (riskStr) {

@ -23,8 +23,8 @@
</div>
<div class="form-group pull-right">
<button ng-hide="ctrl.addAttention" class="btn btn-info" type="button" ng-click="ctrl.addAttention = true"><i class="fa fa-plus"></i>Add</button>
<div class="input-group" ng-if="ctrl.addAttention">
<button class="btn btn-info" type="button" ng-click="addAttention()"><i class="fa fa-plus"></i>Add</button>
<!--<div class="input-group" ng-if="ctrl.addAttention">
<input type="text" class="form-control" ng-model="client_moniker"
title="Add Attention" placeholder="client Moniker">
<div class="input-group-btn">
@ -37,7 +37,7 @@
<i class="fa fa-remove"></i>
</button>
</div>
</div>
</div>-->
</div>
</div>
</div>
@ -55,6 +55,7 @@
<th>Contact Person</th>
<th>Contact Phone</th>
<th>Operation Time</th>
<th>Remark</th>
<th>Operation</th>
</tr>
</thead>
@ -67,6 +68,7 @@
<td>{{client.contact_person}}</td>
<td>{{client.contact_phone}}</td>
<td>{{client.last_update_date}}</td>
<td>{{client.remark}}</td>
<td>
<a role="button" class="text-bold text-danger"
ng-click="disableAttention(client.client_moniker)">Disable</a>

@ -0,0 +1,41 @@
<div class="modal-header">
<h4>New Risk Merchants</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-12">
<form novalidate name="accountForm" class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-3" for="client-moniker">Client Moniker</label>
<div class="col-sm-7">
<input class="form-control" type="text" id="client-moniker" name="client_moniker"
ng-model="attentions.client_moniker">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="attentions-remark">Remark</label>
<div class="col-sm-7">
<input class="form-control" type="text" id="attentions-remark" name="remark"
ng-model="attentions.remark">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="creation-input">Creation</label>
<div class="col-sm-7">
<input class="form-control " ng-model="attentions.creation_date" id="creation-input"
uib-datepicker-popup="yyyy-MM-dd HH:mm:ss" size="10" placeholder="Date"
is-open="creationCtrl.open" ng-click="creationCtrl.open=true">
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<div class="btn-group">
<button class="btn btn-success" type="button" ng-click="save(attentions)">Submit</button>
</div>
<div class="btn-group">
<button class="btn btn-danger" type="button" ng-click="$dismiss()">Cancel</button>
</div>
</div>
Loading…
Cancel
Save