Revert "[Y] 商户编码添加默认值(6位数字字母组合)且不可修改"

This reverts commit e134c27
master
Tayl0r 7 years ago
parent e134c27257
commit 143d19247e

@ -72,7 +72,4 @@ public interface ClientMapper {
List<String> listCityClientIds(@Param("city") String city, @Param("date") Date date); List<String> listCityClientIds(@Param("city") String city, @Param("date") Date date);
List<String> listClientByCleanDays(@Param("clean_days") int clean_days); List<String> listClientByCleanDays(@Param("clean_days") int clean_days);
@AutoSql(type = SqlType.SELECT)
int getPartnercode(@Param("codes") String codes);
} }

@ -13,7 +13,7 @@ import javax.validation.constraints.Pattern;
public class ClientRegisterInfo { public class ClientRegisterInfo {
@JSONField(name = "client_moniker") @JSONField(name = "client_moniker")
@NotEmpty(message = "error.payment.valid.param_missing") @NotEmpty(message = "error.payment.valid.param_missing")
@Pattern(regexp = "^[a-zA-Z0-9]{6}$", message = "Parameter error(partner code):Only letters or numbers are allowed") @Pattern(regexp = "^[a-zA-Z0-9]{4}$", message = "Parameter error(partner code):Only letters or numbers are allowed")
private String clientMoniker; private String clientMoniker;
@NotEmpty(message = "error.payment.valid.param_missing") @NotEmpty(message = "error.payment.valid.param_missing")
@JSONField(name = "company_name") @JSONField(name = "company_name")

@ -264,6 +264,4 @@ public interface ClientManager {
void validRefundPwd(JSONObject account, String pwd); void validRefundPwd(JSONObject account, String pwd);
void setWeekendDelay(int clientId, boolean delay); void setWeekendDelay(int clientId, boolean delay);
String initMerchantCode();
} }

@ -2084,16 +2084,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientMapper.update(clientUpdate); clientMapper.update(clientUpdate);
} }
@Override
public String initMerchantCode() {
String code = RandomStringUtils.randomAlphanumeric(6).toUpperCase();
if (clientMapper.getPartnercode(code) > 0) {
return initMerchantCode();
}
return code;
}
@Override @Override
public void setClientQRCodePaySurCharge(String clientMoniker, boolean paySurcharge) { public void setClientQRCodePaySurCharge(String clientMoniker, boolean paySurcharge) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);

@ -482,8 +482,4 @@ public class PartnerManageController {
public void localMerchantPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public void localMerchantPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.switchPermission(manager, clientMoniker, "local_merchant", pass.getBooleanValue("allow")); clientManager.switchPermission(manager, clientMoniker, "local_merchant", pass.getBooleanValue("allow"));
} }
@RequestMapping(value = "/init/merchant_code", method = RequestMethod.GET)
public String initMerchantCode() {
return clientManager.initMerchantCode();
}
} }

@ -272,7 +272,4 @@
<select id="listClientByCleanDays" resultType="java.lang.String"> <select id="listClientByCleanDays" resultType="java.lang.String">
SELECT client_id FROM sys_clients WHERE is_valid = 1 and clean_days = #{clean_days} SELECT client_id FROM sys_clients WHERE is_valid = 1 and clean_days = #{clean_days}
</select> </select>
<select id="getPartnercode" resultType="int">
SELECT count(1) FROM sys_clients where client_moniker=#{codes};
</select>
</mapper> </mapper>

@ -40,12 +40,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}).state('partners.new', { }).state('partners.new', {
url: '/new', url: '/new',
templateUrl: '/static/payment/partner/templates/add_partner.html', templateUrl: '/static/payment/partner/templates/add_partner.html',
controller: 'addPartnerCtrl', controller: 'addPartnerCtrl'
resolve: {
merchant_code: ['$http', function ($http) {
return $http.get('/sys/partners/init/merchant_code');
}]
}
}).state('partners.detail', { }).state('partners.detail', {
url: '/{clientMoniker}/detail', url: '/{clientMoniker}/detail',
templateUrl: '/static/payment/partner/templates/partner_detail.html', templateUrl: '/static/payment/partner/templates/partner_detail.html',
@ -229,9 +224,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} }
$scope.partner.company_phone_c = 61; $scope.partner.company_phone_c = 61;
$scope.partner.contact_phone_c = 61; $scope.partner.contact_phone_c = 61;
$http.get('/sys/partners/init/merchant_code').then(function (response) {
$scope.partner.client_moniker = response.data;
});
function remove(arr, val) { function remove(arr, val) {
if (angular.isArray(arr)) { if (angular.isArray(arr)) {
@ -1249,10 +1241,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
controller: 'partnerNewSubPartnerDialogCtrl', controller: 'partnerNewSubPartnerDialogCtrl',
size: 'lg', size: 'lg',
resolve: { resolve: {
merchant_code: ['$http', function ($http) {
return $http.get('/sys/partners/init/merchant_code');
}],
clientMoniker: function () { clientMoniker: function () {
return $scope.partner.client_moniker; return $scope.partner.client_moniker;
} }
@ -1546,9 +1534,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
app.controller('partnerNewSubPartnerDialogCtrl', ['$rootScope', '$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone', app.controller('partnerNewSubPartnerDialogCtrl', ['$rootScope', '$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone',
'clientMoniker', 'industryMap', 'businessStructuresMap', 'stateMap', 'countryMap', 'clientMoniker', 'industryMap', 'businessStructuresMap', 'stateMap', 'countryMap',
function ($rootScope, $scope, $http, $state, Upload, commonDialog, timezone, clientMoniker, industryMap, businessStructuresMap, stateMap, countryMap) { function ($rootScope, $scope, $http, $state, Upload, commonDialog, timezone, clientMoniker, industryMap, businessStructuresMap, stateMap, countryMap) {
$http.get('/sys/partners/init/merchant_code').then(function (response) {
$scope.partner.client_moniker = response.data;
});
if ($scope.partner_application) { if ($scope.partner_application) {
$scope.partner = angular.copy($scope.partner_application); $scope.partner = angular.copy($scope.partner_application);
delete $rootScope.partner_application; delete $rootScope.partner_application;

@ -27,7 +27,8 @@
ng-model="partner.client_moniker" ng-model="partner.client_moniker"
type="text" type="text"
name="client_moniker" name="client_moniker"
id="short-id-input" readonly> id="short-id-input" required maxlength="4"
ng-pattern="/^[a-zA-Z0-9]+$/">
<p class="small text-info">No further changeable!</p> <p class="small text-info">No further changeable!</p>
<div ng-messages="partnerForm.client_moniker.$error" <div ng-messages="partnerForm.client_moniker.$error"
ng-if="partnerForm.client_moniker.$dirty"> ng-if="partnerForm.client_moniker.$dirty">

@ -20,7 +20,7 @@
<input class="form-control text-uppercase" ng-model="partner.client_moniker" <input class="form-control text-uppercase" ng-model="partner.client_moniker"
type="text" type="text"
name="client_moniker" name="client_moniker"
id="short-id-input" readonly> id="short-id-input" required maxlength="4" ng-pattern="/^[a-zA-Z0-9]+$/">
<p class="small text-info">No further changeable!</p> <p class="small text-info">No further changeable!</p>
<div ng-messages="partnerForm.client_moniker.$error" <div ng-messages="partnerForm.client_moniker.$error"
ng-if="partnerForm.client_moniker.$dirty"> ng-if="partnerForm.client_moniker.$dirty">

Loading…
Cancel
Save