Risky Merchants优化

master
yangkai 6 years ago
parent e2b56501ab
commit ecd7c2a230

@ -30,7 +30,7 @@ public interface RiskMerchantService {
JSONObject listAttentionMerchants(JSONObject manager, QueryAttentionMerchants queryAttention); 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); void disableAttentionMerchant(JSONObject manager, String clientMoniker);
} }

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

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

@ -233,7 +233,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$http.get('/sys/risk/attention', {params: params}).then(function (resp) { $http.get('/sys/risk/attention', {params: params}).then(function (resp) {
$scope.attentions = resp.data.data; $scope.attentions = resp.data.data;
$scope.pagination = resp.data.pagination; $scope.pagination = resp.data.pagination;
$scope.ctrl.addAttention = false; // $scope.ctrl.addAttention = false;
}); });
}; };
$scope.loadAttentionMerchants(1); $scope.loadAttentionMerchants(1);
@ -255,7 +255,26 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}, function (resp) { }, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); 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 () { app.filter('risk_type', function () {
return function (riskStr) { return function (riskStr) {

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