Merge remote-tracking branch 'origin/develop' into develop

master
yangkai 6 years ago
commit a075614c7b

@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List; 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") @AutoMapper(tablename = "sys_rpay_merchant_apply",pkName = "merchant_app_id")
public interface SysRpayMerchantApplyMapper { public interface SysRpayMerchantApplyMapper {

@ -336,7 +336,8 @@ public interface ClientManager {
void sendHfEmailNotice(JSONObject order); void sendHfEmailNotice(JSONObject order);
void subRpayMerchantApplication(String clientMoniker, JSONObject manager); void subRpayMerchantApplication(String clientMoniker,JSONObject merchantInfo, JSONObject manager);
void updateAllPartnerPassword(String clientMoniker, List<String> emails); void updateAllPartnerPassword(String clientMoniker, List<String> emails);
} }

@ -239,6 +239,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource @Resource
private WxPayClient wxPayClient; private WxPayClient wxPayClient;
@Resource
private RpayApi rpayApi;
@Resource @Resource
private ManagerMapper managerMapper; private ManagerMapper managerMapper;
@Resource @Resource
@ -282,8 +285,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource @Resource
private ClientInfoCacheSupport clientInfoCacheSupport; private ClientInfoCacheSupport clientInfoCacheSupport;
@Resource
private RpayApi rpayApi;
@Resource @Resource
private SimpleClientApplyService simpleClientApplyService; private SimpleClientApplyService simpleClientApplyService;
@Resource @Resource
@ -3598,33 +3599,32 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
public void subRpayMerchantApplication(String clientMoniker, JSONObject manager) { public void subRpayMerchantApplication(String clientMoniker, JSONObject merchantInfo,JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
checkOrgPermission(manager, client); checkOrgPermission(manager, client);
List<JSONObject> listByshortName = sysRpayMerchantApplyMapper.listByShortName(client.getIntValue("client_id"),client.getString("short_name")); List<JSONObject> listByshortName = sysRpayMerchantApplyMapper.listByShortName(client.getIntValue("client_id"),merchantInfo.getString("company_shortname"));
if (listByshortName.size()>0) { if (listByshortName.size()>0) {
throw new BadRequestException("请修改【" + clientMoniker + "】的Company shortName信息请避免和Rpay+商务号列表内的Company Short Name重复"); throw new BadRequestException("请修改【" + clientMoniker + "】的Company shortName信息请避免和Rpay+商务号列表内的Company Short Name重复");
} }
SubRpayMerchantInfo subRpayMerchantInfo = JSONObject.toJavaObject(client, SubRpayMerchantInfo.class); SubRpayMerchantInfo subRpayMerchantInfo = JSONObject.toJavaObject(merchantInfo, SubRpayMerchantInfo.class);
subRpayMerchantInfo.CheckEmpty(); subRpayMerchantInfo.CheckEmpty();
JSONObject rpayMerchantInfo = rpayApi.registerMerchant(client.getIntValue("client_id"), subRpayMerchantInfo); JSONObject rpayMerchantInfo = rpayApi.registerMerchant(client.getIntValue("client_id"), subRpayMerchantInfo);
if (rpayMerchantInfo != null) { if (rpayMerchantInfo != null) {
JSONObject merchantApply = new JSONObject(); merchantInfo.put("merchant_id", rpayMerchantInfo.getString("rpay_order_id"));
merchantApply.put("merchant_id", rpayMerchantInfo.getString("rpay_order_id")); merchantInfo.put("client_id", client.getString("client_id"));
merchantApply.put("client_id", client.getString("client_id")); merchantInfo.put("create_time", new Date());
merchantApply.put("create_time", new Date()); merchantInfo.put("operator", manager.getString("display_name"));
merchantApply.put("operator", manager.getString("display_name")); merchantInfo.put("sub_merchant_id", rpayMerchantInfo.getString("merchantId"));
merchantApply.put("sub_merchant_id", rpayMerchantInfo.getString("merchantId")); merchantInfo.put("business_category", client.getString("royalpayindustry"));
merchantApply.put("business_category", client.getString("royalpayindustry")); merchantInfo.put("merchant_shortname", merchantInfo.getString("company_shortname"));
merchantApply.put("merchant_shortname", client.getString("short_name")); sysRpayMerchantApplyMapper.insertRpayMerchantApply(merchantInfo);
sysRpayMerchantApplyMapper.insertRpayMerchantApply(merchantApply);
clientMapper.updateRpayEnterpriseId(client.getIntValue("client_id"), rpayMerchantInfo.getString("merchantId")); clientMapper.updateRpayEnterpriseId(client.getIntValue("client_id"), rpayMerchantInfo.getString("merchantId"));
}else { }else {
throw new BadRequestException("请求失败"); throw new BadRequestException("请求失败");

@ -17,9 +17,7 @@ import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@ -581,9 +579,10 @@ public class PartnerManageController {
public void switchHfEmailNotice(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public void switchHfEmailNotice(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.switchPermission(manager, clientMoniker, "enable_hf_email_notice", pass.getBooleanValue("allow")); clientManager.switchPermission(manager, clientMoniker, "enable_hf_email_notice", pass.getBooleanValue("allow"));
} }
@ManagerMapping(value = "/{clientMoniker}/registRpaySubMerchantId", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) @ManagerMapping(value = "/{clientMoniker}/registRpaySubMerchantId", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
public void subRpayMerchantApplication(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public void subRpayMerchantApplication(@PathVariable String clientMoniker,@RequestBody JSONObject merchantInfo,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.subRpayMerchantApplication(clientMoniker, manager); clientManager.subRpayMerchantApplication(clientMoniker, merchantInfo,manager);
} }
} }

@ -3142,20 +3142,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}) })
}; };
$scope.applyRpaySubMerchantId = function () { $scope.applyRpaySubMerchantId = function () {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/registRpaySubMerchantId').then(function (resp) { $uibModal.open({
commonDialog.alert({ templateUrl: '/static/payment/partner/templates/apply_rpay_sub_merchant_id.html',
title: 'Success', controller: 'applyRpaySubMerchantIdCtrl',
content: 'Modify Rpay+ Sub Merchant ID successfully', resolve: {
type: 'success' subMerchantInfo: function () {
}); return $scope.partner;
$state.reload(); }
}, function (resp) { }
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) }).result.then(function () {
}); $scope.loadSubMerchantInfos();
})
}; };
$scope.loadSubMerchantInfos(); $scope.loadSubMerchantInfos();
}]); }]);
@ -3203,10 +3200,57 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}); });
} }
}, function (resp) { }, function (resp) {
$scope.errmsg = resp.data.message; commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
}) })
} }
}]); }]);
app.controller('applyRpaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', 'businessStructuresMap','$filter', 'commonDialog','timezone', function ($scope, $http, $uibModal, $state, subMerchantInfo, businessStructuresMap,$filter, commonDialog,timezone) {
$scope.subMerchantInfo = angular.copy(subMerchantInfo);
$scope.business_structures = businessStructuresMap.configs();
$scope.timezone = timezone.configs();
$scope.saveRpayAppliy = function (form) {
var merchantInfo = {};
$scope.errmsg = null;
if (form.$invalid) {
angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true;
}
});
return;
}
angular.forEach(form, function (item, key) {
if(item !=null) {
if(item.$name !=null) {
merchantInfo[key] = item.$modelValue;
}
}
});
$http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/registRpaySubMerchantId', merchantInfo).then(function (resp) {
$scope.apply_sub_merchant_id = resp.data;
$scope.$close();
if (subMerchantInfo.sub_merchant_id != null) {
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'
});
})
}
}]);
app.controller('permissionClientCtrl', ['$scope', '$http', '$uibModal', '$state', '$filter', 'commonDialog', function ($scope, $http, $uibModal, $state, $filter, commonDialog) { 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.clientPermission = {client_moniker:$scope.partner.client_moniker};
$scope.loadPermissionList = function () { $scope.loadPermissionList = function () {

@ -0,0 +1,243 @@
<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 Rpay+ Sub Merchant Id</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group"
ng-class="{'has-error':subForm.company_name.$invalid && subForm.company_name.$dirty}">
<label class="control-label col-sm-3" for="company_name_input">* Company Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_name"
type="text" name="company_name" id="company_name_input" required maxlength="50">
<div ng-messages="subForm.company_name.$error" ng-if="subForm.company_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.business_name.$invalid && subForm.business_name.$dirty}">
<label class="control-label col-sm-3" for="business_name_input">* Business Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.business_name"
type="text" name="business_name" id="business_name_input" required maxlength="50">
<div ng-messages="subForm.business_name.$error" ng-if="subForm.business_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.company_shortname.$invalid && subForm.company_shortname.$dirty}">
<label class="control-label col-sm-3" for="company_shortname_input">* Company Short Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.short_name"
type="text" name="company_shortname" id="company_shortname_input" required maxlength="50">
<div ng-messages="subForm.company_shortname.$error" ng-if="subForm.company_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">
<label class="control-label col-sm-3" for="company_website_input">Website</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_website"
type="text" name="company_website" id="company_website_input">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.description.$invalid && subForm.description.$dirty}">
<label class="control-label col-sm-3" for="description_input">* Company description</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.description"
type="text" name="description" id="description_input" required maxlength="256">
<div ng-messages="subForm.description.$error" ng-if="subForm.description.$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>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.abn.$invalid && subForm.abn.$dirty}">
<label class="control-label col-sm-3" for="abn_input">* abn</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.abn"
type="text" name="abn" id="abn_input" required maxlength="256">
<div ng-messages="subForm.abn.$error" ng-if="subForm.abn.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.acn.$invalid && subForm.acn.$dirty}">
<label class="control-label col-sm-3" for="acn_input">* acn</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.acn"
type="text" name="acn" id="acn_input" required maxlength="256">
<div ng-messages="subForm.acn.$error" ng-if="subForm.acn.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.business_structure.$invalid && subForm.business_structure.$dirty}">
<label class="control-label col-sm-3" for="business-structure-input">* Business Structure</label>
<div class="col-sm-8">
<select class="form-control" name="business_structure" ng-model="subMerchantInfo.business_structure"
id="business-structure-input"
ng-options="structure.value as structure.label for structure in business_structures">
<option value="">Please Choose</option>
</select>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.company_phone.$invalid && subForm.company_phone.$dirty}">
<label class="control-label col-sm-3" for="company_phone_input">* Company Phone</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_phone"
type="tel" name="company_phone" id="company_phone_input" required maxlength="256">
<div ng-messages="subForm.company_phone.$error" ng-if="subForm.company_phone.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.contact_name.$invalid && subForm.contact_name.$dirty}">
<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" required maxlength="256">
<div ng-messages="subForm.contact_name.$error" ng-if="subForm.contact_name.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.contact_phone.$invalid && subForm.contact_phone.$dirty}">
<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" required maxlength="256">
<div ng-messages="subForm.contact_phone.$error" ng-if="subForm.contact_phone.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.contact_email.$invalid && subForm.contact_email.$dirty}">
<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" required maxlength="256">
<div ng-messages="subForm.contact_email.$error" ng-if="subForm.contact_email.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.country.$invalid && subForm.country.$dirty}">
<label class="control-label col-sm-3" for="country_input">* Company country</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.country"
type="text" name="country" id="country_input" required maxlength="256">
<div ng-messages="subForm.country.$error" ng-if="subForm.country.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.address.$invalid && subForm.address.$dirty}">
<label class="control-label col-sm-3" for="company_address_input">* Company address</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.address"
type="text" name="address" id="company_address_input" required maxlength="256">
<div ng-messages="subForm.address.$error" ng-if="subForm.address.$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.suburb.$invalid && subForm.suburb.$dirty}">
<label class="control-label col-sm-3" for="company_suburb_input">* suburb</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.suburb"
type="text" name="suburb" id="company_suburb_input" required maxlength="256">
<div ng-messages="subForm.suburb.$error" ng-if="subForm.suburb.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.postcode.$invalid && subForm.postcode.$dirty}">
<label class="control-label col-sm-3" for="company_postcode_input">* postCode</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.postcode"
type="text" name="postcode" id="company_postcode_input" required maxlength="256">
<div ng-messages="subForm.postcode.$error" ng-if="subForm.postcode.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.state.$invalid && subForm.state.$dirty}">
<label class="control-label col-sm-3" for="state_input">* state</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.state"
type="text" name="state" id="state_input" required maxlength="256">
<div ng-messages="subForm.state.$error" ng-if="subForm.state.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 10</p>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="timezone-input">TimeZone</label>
<div class="col-sm-8">
<select class="form-control" name="timezone" ng-model="subMerchantInfo.timezone"
id="timezone-input"
ng-options="tz.key as tz.detail for tz in timezone">
<option value="">Please Choose</option>
</select>
</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="saveRpayAppliy(subForm)">Submit
</button>
</div>
</div>
</div>
</form>
</div>

@ -3,7 +3,7 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">Apply Sub Merchant Id</div> <div class="panel-heading">Apply Wechat Sub Merchant Id</div>
<div class="panel-body"> <div class="panel-body">
<div class="form-horizontal"> <div class="form-horizontal">
<div class="form-group" <div class="form-group"
Loading…
Cancel
Save