master
wangning 7 years ago
parent 7c8c0c56c9
commit ce27310c40

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.application.beans;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.NotEmpty;
/**
@ -43,17 +44,19 @@ public class ClientPreApplyBean {
private String bank_name;
@NotEmpty(message = "bsb_no can't be null")
private String bsb_no;
@NotEmpty(message = "clean_days can't be null")
private String clean_days;
@NotEmpty(message = "codeKey can't be null")
private String codeKey;
@NotEmpty(message = "agree can't be null")
private boolean agree;
public JSONObject insertObject() {
JSONObject res = (JSONObject) JSON.toJSON(this);
res.keySet().forEach(p-> {
if (StringUtils.isEmpty(res.getString(p).trim())) {
res.remove(p);
}
});
return res;
}
public String getCompany_name() {

@ -230,7 +230,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
applyInfo.put("client_pre_apply_id", apply.getIntValue("client_pre_apply_id"));
applyInfo.put("update_time", new Date());
sysClientPreMapperMapper.update(applyInfo);
if(applyInfo.getBoolean("agree")){
if(applyInfo.getBooleanValue("agree")){
applyerToClient(username);
}
}

@ -293,14 +293,14 @@
<div class="form-group has-feedback"
ng-class="{'has-error':accountForm.code.$invalid && accountForm.code.$dirty}">
<input class="form-control" ng-model="partner.code" placeholder="Code"
required maxlength="50" name="code">
<input class="form-control" type="number" ng-model="partner.phoneCodeKey" placeholder="Code"
required maxlength="10" name="code">
</div>
<div class="row">
<div class="col-xs-12 margin-bottom">
<button type="button" class="btn btn-success btn-block btn-flat"
ng-click="saveApplyInfo(accountForm,1)">Next
ng-click="saveStep1(accountForm,1)">Next
</button>
<div>
<p ng-if="resError" style="padding: 6px 12px;font-size: 14px;"

@ -72,9 +72,15 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
$scope.disabledArray = new Array(true, false, false, false, false);
$scope.chooseArray = new Array(true, false, false, false, false);
$scope.changeChoose = function (index) {
angular.forEach($scope.partner, function(key, value) {
if(value.trim()==''){
$scope.partner.remove(key);
}
});
$scope.chooseArray = new Array(false, false, false, false, false);
$scope.chooseArray[index] = true;
$scope.disabledArray[index] = true;
};
$scope.getRateConfig = function () {
$http.get('/sys/partners/sys_rates').then(function (resp) {
@ -170,13 +176,15 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
});
return;
}
$scope.partner.codeKey = Math.random().toString(16).substring(2);
$scope.initParam();
$http.post('/register/info/update/' + $scope.partner.username +'/step1', $scope.partner).then(function (resp) {
$scope.changeChoose(index);
$scope.partner.codeKey = resp.data.codeKey;
}, function (resp) {
$scope.resError = resp.data.message;
});
};
$scope.saveApplyInfo = function (form,index) {
if (form.$invalid) {
angular.forEach(form, function (item, key) {
@ -186,9 +194,7 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
});
return;
}
if(index == 1){
$scope.partner.codeKey = Math.random().toString(16).substring(2);
}
$scope.initParam();
$http.post('/register/info/update/' + $scope.partner.username, $scope.partner).then(function (resp) {
if (index == 3) {
$scope.getRateConfig();
@ -201,4 +207,48 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
$scope.resError = resp.data.message;
});
};
$scope.initParam = function () {
if(!$scope.partner.company_name){
$scope.partner.company_name = ' ';
}
if(!$scope.partner.short_name){
$scope.partner.short_name = ' ';
}
if(!$scope.partner.company_phone){
$scope.partner.company_phone = ' ';
}
if(!$scope.partner.address){
$scope.partner.address = ' ';
}
if(!$scope.partner.suburb){
$scope.partner.suburb = ' ';
}
if(!$scope.partner.state){
$scope.partner.state = ' ';
}
if(!$scope.partner.postcode){
$scope.partner.postcode = ' ';
}
if(!$scope.partner.industry){
$scope.partner.industry = ' ';
}
if(!$scope.partner.bank_no){
$scope.partner.bank_no = ' ';
}
if(!$scope.partner.bank_name){
$scope.partner.bank_name = ' ';
}
if(!$scope.partner.bsb_no){
$scope.partner.bsb_no = ' ';
}
if(!$scope.partner.clean_days){
$scope.partner.clean_days = ' ';
}
if(!$scope.partner.abn){
$scope.partner.abn = ' ';
}
}
}]);
Loading…
Cancel
Save