master
luoyang 6 years ago
parent 4f73be6d88
commit 49548f0137

@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Created by yangluo on 2017-03-14.
* Created by yangluo on 2018-09-18.
*/
@AutoMapper(tablename = "sys_rpay_merchant_apply",pkName = "merchant_app_id")
public interface SysRpayMerchantApplyMapper {
@ -21,6 +21,6 @@ public interface SysRpayMerchantApplyMapper {
void insertRpayMerchantApply(JSONObject params);
@AutoSql(type = SqlType.SELECT)
List<JSONObject> selectByShortName(@Param("client_id") int client_id,@Param("merchant_shortname") String shortName);
List<JSONObject> listByShortName(@Param("client_id") int client_id,@Param("merchant_shortname") String shortName);
}

@ -3582,9 +3582,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
checkOrgPermission(manager, client);
List<JSONObject> selectByshortName = sysRpayMerchantApplyMapper.selectByShortName(client.getIntValue("client_id"),client.getString("short_name"));
List<JSONObject> listByshortName = sysRpayMerchantApplyMapper.listByShortName(client.getIntValue("client_id"),client.getString("short_name"));
if (selectByshortName.size()>0) {
if (listByshortName.size()>0) {
throw new BadRequestException("请修改【" + clientMoniker + "】的Company shortName信息请避免和Rpay+商务号列表内的Company Short Name重复");
}

@ -3129,20 +3129,29 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
};
$scope.applyRpaySubMerchantId = function () {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/registRpaySubMerchantId').then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Modify Rpay+ Sub Merchant ID successfully',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
$uibModal.open({
templateUrl: '/static/payment/partner/templates/apply_rpay_sub_merchant_id',
controller: 'applyRpaySubMerchantIdCtrl',
resolve: {
subMerchantInfo: function () {
return $scope.partner;
},
merchantIds: ['$http', '$stateParams', function ($http) {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/registRpaySubMerchantId').then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Modify Rpay+ Sub Merchant ID successfully',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
}]
}
}).result.then(function () {
$scope.loadSubMerchantInfos();
})
};
$scope.loadSubMerchantInfos();
}]);
@ -3194,6 +3203,56 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
}
}]);
app.controller('applyRpaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog) {
$scope.wxIndustries = angular.copy(wxMerchantIndustries);
$scope.subMerchantInfo = angular.copy(subMerchantInfo);
$scope.merchantIds = merchantIds.data;
$scope.subMerchantInfo.industry = $filter('wxindustries')($scope.subMerchantInfo.industry);
$scope.saveAppliy = function (form) {
$scope.errmsg = null;
if (form.$invalid) {
angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true;
}
});
return;
}
$http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/registRpaySubMerchantId', $scope.subMerchantInfo).then(function (resp) {
$scope.apply_sub_merchant_id = resp.data;
$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();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
}
}, function (resp) {
$scope.errmsg = resp.data.message;
})
}
}]);
app.controller('permissionClientCtrl', ['$scope', '$http', '$uibModal', '$state', '$filter', 'commonDialog', function ($scope, $http, $uibModal, $state, $filter, commonDialog) {
$scope.clientPermission = {client_moniker:$scope.partner.client_moniker};
$scope.loadPermissionList = function () {

@ -0,0 +1,164 @@
<div class="content">
<form novalidate name="subForm">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">Apply Sub Merchant Id</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group"
ng-class="{'has-error':subForm.merchant_name.$invalid && subForm.merchant_name.$dirty}">
<label class="control-label col-sm-3" for="merchant_name_input">* Merchant Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_name"
type="text" name="merchant_name" id="merchant_name_input" required maxlength="50">
<div ng-messages="subForm.merchant_name.$error" ng-if="subForm.merchant_name.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.merchant_id.$invalid && subForm.merchant_id.$dirty}">
<label class="control-label col-sm-3" for="business_category_input">* Merchant ID</label>
<div class="col-sm-8">
<select class="form-control" name="merchant_id"
ng-model="subMerchantInfo.merchant_id"
id="merchant_id_input" required
ng-options="merchant_id.merchant_id as merchant_id.merchant_id for merchant_id in merchantIds">
<option value="">Please Choose</option>
</select>
<div ng-messages="subForm.merchant_id.$error" ng-if="subForm.merchant_id.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
<div ng-messages="subForm.business_category.$error" ng-if="subForm.business_category.$dirty">
<p class="small text-danger" ng-message="maxLength">More than 50</p>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.merchant_shortname.$invalid && subForm.merchant_shortname.$dirty}">
<label class="control-label col-sm-3" for="merchant_shortname_input">* Merchant Short Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.short_name"
type="text" name="merchant_shortname" id="merchant_shortname_input" required maxlength="50">
<div ng-messages="subForm.merchant_shortname.$error" ng-if="subForm.merchant_shortname.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.business_category.$invalid && subForm.business_category.$dirty}">
<label class="control-label col-sm-3" for="business_category_input">* Business Category</label>
<div class="col-sm-8">
<select class="form-control" name="business_category"
ng-model="subMerchantInfo.industry"
id="business_category_input" required
ng-options="industry.value as industry.label for industry in wxIndustries">
<option value="">Please Choose</option>
</select>
<div ng-messages="subForm.business_category.$error" ng-if="subForm.business_category.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
<div ng-messages="subForm.business_category.$error" ng-if="subForm.business_category.$dirty">
<p class="small text-danger" ng-message="maxLength">More than 50</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="website_input">Website</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_website"
type="url" name="website" id="website_input">
</div>
</div>
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
<div class="form-group"
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>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.remark"
type="text" name="merchant_remark" id="merchant_remark_input" maxlength="20" required>
<div ng-messages="subForm.merchant_remark.$error" ng-if="subForm.merchant_remark.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 20</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.merchant_introduction.$invalid && subForm.merchant_introduction.$dirty}">
<label class="control-label col-sm-3" for="merchant_introduction_input">* Merchant Introduction</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.description"
type="text" name="merchant_introduction" id="merchant_introduction_input" required maxlength="256" MINLENGTH="10">
<div ng-messages="subForm.merchant_introduction.$error" ng-if="subForm.merchant_introduction.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 256</p>
<p class="small text-danger" ng-message="minlength">Length is less than 10</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.office_phone.$invalid && subForm.office_phone.$dirty}">
<label class="control-label col-sm-3" for="office_phone_input">* Office Phone</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_phone"
type="tel" name="office_phone" id="office_phone_input" required>
<div ng-messages="subForm.office_phone.$error" ng-if="subForm.office_phone.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="contact_name_input">Contact Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.contact_person"
type="text" name="contact_name" id="contact_name_input">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="contact_phone_input">Contact Phone</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.contact_phone"
type="text" name="contact_phone" id="contact_phone_input">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="contact_email_input">Contact Email</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.contact_email"
type="text" name="contact_email" id="contact_email_input">
</div>
</div>
</div>
</div>
</div>
<!--end 商品基本资料-->
<!--<div class="panel panel-default">-->
<!--<div class="panel-heading">Goods Qr Code</div>-->
<!--<div class="panel-body">-->
<!--</div>-->
<!--</div>-->
<!--end 商品二维码-->
<div class="btn-group margin-bottom margin-top">
<button class="btn btn-success" type="button"
ng-click="saveAppliy(subForm)">Submit
</button>
</div>
</div>
</div>
</form>
</div>
Loading…
Cancel
Save