master
yuan 7 years ago
parent 511faafdda
commit 86d07c5f69

@ -268,7 +268,7 @@ public interface ClientManager {
List<JSONObject> listSubMerchantIdApplys(JSONObject manager, String clientMoniker); List<JSONObject> listSubMerchantIdApplys(JSONObject manager, String clientMoniker);
void subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager); String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager);
List<JSONObject> listMerchantIds(String clientMoniker,JSONObject manager); List<JSONObject> listMerchantIds(String clientMoniker,JSONObject manager);

@ -2962,8 +2962,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
object.put("merchant_id",client.getString("merchant_id")); object.put("merchant_id",client.getString("merchant_id"));
object.put("create_time",new Date()); object.put("create_time",new Date());
object.put("operator",manager.getString("display_name")); object.put("operator",manager.getString("display_name"));
sysWxMerchantApplyMapper.insertWxMerchantApply(object); List<JSONObject> applyQuery = new ArrayList<>();
List<JSONObject> applyQuery = sysWxMerchantApplyMapper.listWxMerchantApplices(client.getInteger("client_id"),new PageBounds(Order.formString("create_time.desc"))); applyQuery.add(object);
return applyQuery; return applyQuery;
} }
} }
@ -2971,7 +2971,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
@CacheEvict(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker") @CacheEvict(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker")
public void subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager) { public String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
@ -2979,7 +2979,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
checkOrgPermission(manager, client); checkOrgPermission(manager, client);
JSONObject params = subMerchantApply.insertObject(); JSONObject params = subMerchantApply.insertObject();
SubMerchantInfo subMerchantInfo = JSONObject.toJavaObject(params,SubMerchantInfo.class); SubMerchantInfo subMerchantInfo = JSONObject.toJavaObject(params,SubMerchantInfo.class);
params.put("merchant_id",client.getString("merchant_id")); params.put("merchant_id",subMerchantApply.getMerchant_id());
params.put("client_id",client.getString("client_id")); params.put("client_id",client.getString("client_id"));
params.put("create_time",new Date()); params.put("create_time",new Date());
params.put("operator",manager.getString("display_name")); params.put("operator",manager.getString("display_name"));
@ -2990,8 +2990,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
sysWxMerchantApplyMapper.insertWxMerchantApply(params); sysWxMerchantApplyMapper.insertWxMerchantApply(params);
clearCacheSubMerchantIdApplices(clientMoniker); clearCacheSubMerchantIdApplices(clientMoniker);
}else { }else {
throw new BadRequestException(); throw new BadRequestException(elem.elementText("return_msg"));
} }
return sub_merchant_id;
} }
@Override @Override

@ -489,8 +489,8 @@ public class PartnerManageController {
} }
@ManagerMapping(value = "/{clientMoniker}/sub_apply",method = RequestMethod.POST,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN}) @ManagerMapping(value = "/{clientMoniker}/sub_apply",method = RequestMethod.POST,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN})
public void subMerchantApplication(@PathVariable String clientMoniker, @RequestBody SubMerchantIdApply subMerchantIdApply, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public String subMerchantApplication(@PathVariable String clientMoniker, @RequestBody SubMerchantIdApply subMerchantIdApply, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.subMerchantApplication(clientMoniker,subMerchantIdApply,manager); return clientManager.subMerchantApplication(clientMoniker,subMerchantIdApply,manager);
} }
@ManagerMapping(value = "/{clientMoniker}/get_merchant_ids",method = RequestMethod.GET,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN}) @ManagerMapping(value = "/{clientMoniker}/get_merchant_ids",method = RequestMethod.GET,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN})

@ -32,51 +32,51 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
]; ];
var wxMerchantIndustries = [ var wxMerchantIndustries = [
{ {
"label": "鞋包服饰", "label": "鞋包服饰|Shoes&Garments",
"value": "343" "value": "343"
}, },
{ {
"label": "机票行业", "label": "机票行业|Air Ticket",
"value": "493" "value": "493"
}, },
{ {
"label": "文具/办公用品", "label": "文具/办公用品|Stationery/office supplies",
"value": "492" "value": "492"
}, },
{ {
"label": "酒店行业", "label": "酒店行业|Hotel Industry",
"value": "491" "value": "491"
}, },
{ {
"label": "教育行业", "label": "教育行业|Education Industry",
"value": "490" "value": "490"
}, },
{ {
"label": "国际物流", "label": "国际物流|Logistics",
"value": "489" "value": "489"
}, },
{ {
"label": "数码电器", "label": "数码电器|Digital appliance",
"value": "488" "value": "488"
}, },
{ {
"label": "母婴", "label": "母婴|Maternal and infant",
"value": "487" "value": "487"
}, },
{ {
"label": "化妆品", "label": "化妆品|Cosmetics",
"value": "486" "value": "486"
}, },
{ {
"label": "食品", "label": "食品|Food",
"value": "485" "value": "485"
}, },
{ {
"label": "综合商城", "label": "综合商城|Comprehensive mall",
"value": "484" "value": "484"
}, },
{ {
"label": "其它货物贸易行业", "label": "其它货物贸易行业|Other trade industry",
"value": "494" "value": "494"
} }
]; ];
@ -2576,12 +2576,24 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} }
} }
}]); }]);
app.controller('subMerchantIdApplicaitonsCtrl', ['$scope', '$http', '$uibModal','$state', function ($scope, $http, $uibModal, $state) { app.controller('subMerchantIdApplicaitonsCtrl', ['$scope', '$http', '$uibModal','$state','commonDialog', function ($scope, $http, $uibModal, $state,commonDialog) {
$scope.loadSubMerchantInfos = function () { $scope.loadSubMerchantInfos = function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/list_sub_applices', {params: {}}).then(function (resp) { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/list_sub_applices', {params: {}}).then(function (resp) {
$scope.subMerchantInfos = resp.data; $scope.subMerchantInfos = resp.data;
}); });
}; };
$scope.useSubMerchantId = function (sub_merchant_id) {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/payment_config', {sub_merchant_id: sub_merchant_id}).then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Modify Wechat Sub Merchant ID successfully',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
}
$scope.applySubMerchantId = function () { $scope.applySubMerchantId = function () {
$uibModal.open({ $uibModal.open({
templateUrl: '/static/payment/partner/templates/apply_sub_merchant_id.html', templateUrl: '/static/payment/partner/templates/apply_sub_merchant_id.html',
@ -2600,7 +2612,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}; };
$scope.loadSubMerchantInfos(); $scope.loadSubMerchantInfos();
}]); }]);
app.controller('applySubMerchantIdCtrl', ['$scope', '$http', '$uibModal','$state','subMerchantInfo', '$filter','merchantIds', function ($scope, $http, $uibModal, $state, subMerchantInfo,$filter,merchantIds) { app.controller('applySubMerchantIdCtrl', ['$scope', '$http', '$uibModal','$state','subMerchantInfo', '$filter','merchantIds','commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo,$filter,merchantIds,commonDialog) {
$scope.wxIndustries = angular.copy(wxMerchantIndustries); $scope.wxIndustries = angular.copy(wxMerchantIndustries);
$scope.subMerchantInfo = angular.copy(subMerchantInfo); $scope.subMerchantInfo = angular.copy(subMerchantInfo);
$scope.merchantIds = merchantIds.data; $scope.merchantIds = merchantIds.data;
@ -2615,10 +2627,34 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}); });
return; return;
} }
$http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker+ '/sub_apply', $scope.subMerchantInfo).then(function () { $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker+ '/sub_apply', $scope.subMerchantInfo).then(function (resp) {
alert("Success"); $scope.apply_sub_merchant_id = resp.data;
$scope.$close(); $scope.$close();
if(subMerchantInfo.sub_merchant_id != null){
commonDialog.confirm({title:'Confirm',content:'已申请成功,是否确认使用'}).then(function () {
$http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Modify Wechat Sub Merchant ID successfully',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
})
}else {
$http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Apply Success And Modify Wechat Sub Merchant ID successfully',
type: 'success'
});
$state.reload(); $state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
}
}, function (resp) { }, function (resp) {
$scope.errmsg = resp.data.message; $scope.errmsg = resp.data.message;
}) })
@ -2640,7 +2676,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
return bdUsers; return bdUsers;
} }
}); });
app.filter('wxMerchants', function () {
return function (values) {
var industry = '';
angular.forEach(wxMerchantIndustries, function (wxMerchant) {
if (wxMerchant.value == values) {
industry = wxMerchant.label;
}
});
return industry;
}
});
app.filter('bdOrgSelect', function () { app.filter('bdOrgSelect', function () {
return function (bdUsers, params) { return function (bdUsers, params) {
var org_id; var org_id;
@ -2700,5 +2746,24 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} }
} }
}); });
app.filter('cut', function () {
return function (value, wordwise, max, tail) {
if (!value) return '';
max = parseInt(max, 10);
if (!max) return value;
if (value.length <= max) return value;
value = value.substr(0, max);
if (wordwise) {
var lastspace = value.lastIndexOf(' ');
if (lastspace != -1) {
value = value.substr(0, lastspace);
}
}
return value + (tail || ' …');
};
});
return app; return app;
}); });

@ -5,7 +5,6 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">Apply Sub Merchant Id</div> <div class="panel-heading">Apply Sub Merchant Id</div>
<div class="panel-body"> <div class="panel-body">
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
<div class="form-horizontal"> <div class="form-horizontal">
<div class="form-group" <div class="form-group"
ng-class="{'has-error':subForm.merchant_name.$invalid && subForm.merchant_name.$dirty}"> ng-class="{'has-error':subForm.merchant_name.$invalid && subForm.merchant_name.$dirty}">
@ -76,13 +75,13 @@
<label class="control-label col-sm-3" for="website_input">* Website</label> <label class="control-label col-sm-3" for="website_input">* Website</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_website" <input class="form-control" ng-model="subMerchantInfo.company_website"
type="text" name="website" id="website_input" required> type="url" name="website" id="website_input" required>
<div ng-messages="subForm.website.$error" ng-if="subForm.website.$dirty"> <div ng-messages="subForm.website.$error" ng-if="subForm.website.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
</div> </div>
</div> </div>
</div> </div>
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
<div class="form-group" <div class="form-group"
ng-class="{'has-error':subForm.merchant_remark.$invalid && subForm.merchant_remark.$dirty}"> ng-class="{'has-error':subForm.merchant_remark.$invalid && subForm.merchant_remark.$dirty}">
<label class="control-label col-sm-3" for="merchant_remark_input">* Merchant Remark</label> <label class="control-label col-sm-3" for="merchant_remark_input">* Merchant Remark</label>
@ -155,7 +154,7 @@
<!--end 商品二维码--> <!--end 商品二维码-->
<div class="btn-group margin-bottom margin-top"> <div class="btn-group margin-bottom margin-top">
<button ng-disabled="subForm.$dirty&&subForm.$invalid" class="btn btn-success" type="button" <button ng-disabled="subForm.$dirty&&subForm.$invalid" class="btn btn-success" type="button"
ng-click="saveAppliy(subForm)">Save ng-click="saveAppliy(subForm)">Submit
</button> </button>
</div> </div>
</div> </div>

@ -1,9 +1,39 @@
<style>
.box_desk{
width: 96%;
height: 87%;
background: rgba(0, 0, 0, .65);
position: absolute;
bottom: 28px;
transition: all linear 0.5s;
opacity:0;
}
.box-body:hover .box_desk{
padding: 0px;
opacity: 0.8;
display: block;
}
.content_button{
display: block;
position: absolute;
top: 50%;
margin-left: 50%;
transform: translate(-50%, -50%);
color: #fff;
text-align: left;
font-size: 14px;
}
</style>
<div class="content"> <div class="content">
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="box-solid"> <div class="box-solid">
<div class="box box-warning"> <div class="box box-warning">
<div class="box-header"> <div class="box-header">
<h3 class="box-title pull-left" ng-if="partner.sub_merchant_id">
Sub Merchant Id : {{partner.sub_merchant_id}}
<i class="fa fa-clock-o text-danger" title="Using temp Sub Merchant ID" ng-if="partner.temp_sub_merchant"></i>
</h3>
<button role="button" class="btn btn-info pull-right" title="Apply Sub Merchant Id" <button role="button" class="btn btn-info pull-right" title="Apply Sub Merchant Id"
ng-click="applySubMerchantId()"> ng-click="applySubMerchantId()">
<i class="fa fa-plus"></i> <i class="fa fa-plus"></i>
@ -16,10 +46,12 @@
<h3 class="box-title">List of Sub Merchant Id</h3> <h3 class="box-title">List of Sub Merchant Id</h3>
</div> </div>
<div class="box-body col-sm-6" ng-repeat="id_apply in subMerchantInfos"> <div class="box-body col-sm-6" ng-repeat="id_apply in subMerchantInfos">
<ul class="list-group"> <ul class="list-group ui_desk">
<li class="list-group-item list-group-item-success"> <li class="list-group-item list-group-item-success">
<b>Sub Merchant Id</b> <b>Sub Merchant Id</b>
<b style="float: right" ng-bind="id_apply.sub_merchant_id"></b> <b style="float: right"><span
ng-if="partner.sub_merchant_id == id_apply.sub_merchant_id"><small
class="text-red">(当前使用)</small></span>{{id_apply.sub_merchant_id}}</b>
</li> </li>
<li class="list-group-item list-group-item-success"> <li class="list-group-item list-group-item-success">
Apply Time Apply Time
@ -27,27 +59,29 @@
</li> </li>
<li class="list-group-item list-group-item-success"> <li class="list-group-item list-group-item-success">
Merchant Short Name Merchant Short Name
<span style="float: right" ng-bind="id_apply.merchant_shortname"></span> <span style="float:right;">{{id_apply.merchant_shortname | cut:true:20:' ...'}}</span>
</li> </li>
<li class="list-group-item list-group-item-success"> <li class="list-group-item list-group-item-success">
Business Category Business Category
<span style="float: right" ng-bind="id_apply.business_category"></span> <span style="float: right">{{id_apply.business_category | wxMerchants}}</span>
</li> </li>
<li class="list-group-item list-group-item-success"> <li class="list-group-item list-group-item-success">
Description Description
<span style="float: right" ng-bind="id_apply.merchant_introduction"></span> <span style="float: right;">{{id_apply.merchant_introduction | cut:true:20:' ...'}}</span>
</li> </li>
<!-- <li class="list-group-item list-group-item-success">
Merchant Remark
<span style="float: right" ng-bind="id_apply.merchant_remark"></span>
</li>-->
<li class="list-group-item list-group-item-success"> <li class="list-group-item list-group-item-success">
Operator Operator
<span style="float: right" ng-bind="id_apply.operator"></span> <span style="float: right" ng-bind="id_apply.operator"></span>
</li> </li>
</ul> </ul>
<div class="box_desk">
<div class="content_button">
<button role="button" class="btn btn-info" title="use"
ng-click="useSubMerchantId(id_apply.sub_merchant_id)">
USE
</button>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save