Browse Source

机构入驻当前用户获取以及相关调整

huangct 8 years ago
parent
commit
93f0c7b5b5

+ 122 - 55
donate-console/src/main/webapp/resources/js/index/app.js

@@ -563,10 +563,25 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
     /**
     /**
      * 机构入驻选择
      * 机构入驻选择
      */
      */
-    app.controller('SelectInstitutionsNatureCtrl', ['$scope', 'toaster', 'Organization', '$location',
-        function ($scope, toaster, Organization, $location) {
+    app.controller('SelectInstitutionsNatureCtrl', ['$scope', 'toaster', 'Organization', '$location', 'AuthenticationService',
+        function ($scope, toaster, Organization, $location, AuthenticationService) {
             // 获取当前账户注册机构情况
             // 获取当前账户注册机构情况
-            Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041558
+            AuthenticationService.getAuthentication().success(function (data) {
+                if (data.content) {
+                    $scope.userUU = data.content.userUU;
+
+                    Organization.getByUuid({uuid : $scope.userUU}, {}, function(data) {//10041558
+                        $scope.org = data;
+                    }, function() {
+                        toaster.pop('error', '注册情况加载失败');
+                    });
+                }
+                if (data == null || !data.content) {
+                    //$scope.isAuthed = false;
+                    AuthenticationService.redirectSignin();
+                }
+            });
+            Organization.getByUuid({uuid : $scope.userUU}, {}, function(data) {//10041558
                 $scope.org = data;
                 $scope.org = data;
             }, function() {
             }, function() {
                 toaster.pop('error', '注册情况加载失败');
                 toaster.pop('error', '注册情况加载失败');
@@ -685,8 +700,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
     /**
     /**
      * 机构入驻同意协议
      * 机构入驻同意协议
      */
      */
-    app.controller('CertificationStep0Ctrl', ['$scope', 'toaster', 'Organization', '$location',
-        function ($scope, toaster, Organization, $location) {
+    app.controller('CertificationStep0Ctrl', ['$scope', 'toaster', 'Organization', '$location', 'AuthenticationService',
+        function ($scope, toaster, Organization, $location, AuthenticationService) {
             $scope.checked = true;
             $scope.checked = true;
             $scope.changeChecked = function() {
             $scope.changeChecked = function() {
                 $scope.checked = !$scope.checked;
                 $scope.checked = !$scope.checked;
@@ -703,39 +718,59 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
             }
             }
 
 
             // 获取当前账户注册机构情况
             // 获取当前账户注册机构情况
-            Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041558
-                if (typeof data.id == 'undefined') {
-                    return;
+            AuthenticationService.getAuthentication().success(function (data) {
+                if (data.content) {
+                    $scope.userUU = data.content.userUU;
+
+                    Organization.getByUuid({uuid : $scope.userUU}, {}, function(data) {//10041558
+                        if (typeof data.id == 'undefined') {
+                            return;
+                        }
+                        $scope.checked = true;
+                    }, function() {
+                        toaster.pop('error', '注册情况加载失败');
+                    });
+                }
+                if (data == null || !data.content) {
+                    //$scope.isAuthed = false;
+                    AuthenticationService.redirectSignin();
                 }
                 }
-                $scope.checked = true;
-            }, function() {
-                toaster.pop('error', '注册情况加载失败');
             });
             });
+
         }]);
         }]);
 
 
     /**
     /**
      * 机构认证第一步
      * 机构认证第一步
      */
      */
-    app.controller('CertificationStep1Ctrl', ['$scope', 'BaseService', '$http', '$rootScope', '$timeout', '$location', '$filter', 'toaster', 'Organization',
-        function ($scope, BaseService, $http, $rootScope, $timeout, $location, $filter, toaster, Organization) {
+    app.controller('CertificationStep1Ctrl', ['$scope', 'BaseService', '$http', '$rootScope', '$timeout', '$location', '$filter', 'toaster', 'Organization', 'AuthenticationService',
+        function ($scope, BaseService, $http, $rootScope, $timeout, $location, $filter, toaster, Organization, AuthenticationService) {
             // 主要领域
             // 主要领域
             // $scope.areas = ['疾病援助', '扶贫/救灾', '教育/助学' , '环境/动物保护', '其他'];
             // $scope.areas = ['疾病援助', '扶贫/救灾', '教育/助学' , '环境/动物保护', '其他'];
-
             $scope.org = {
             $scope.org = {
                 majorArea: 1
                 majorArea: 1
             };
             };
 
 
             var orgCopy;
             var orgCopy;
             // 获取当前账户注册机构情况
             // 获取当前账户注册机构情况
-            Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041558
-                if (typeof data.id == 'undefined') {
-                    return;
-                }
+            AuthenticationService.getAuthentication().success(function (data) {
+                if (data.content) {
+                    $scope.userUU = data.content.userUU;
 
 
-                $scope.org = data;
-                orgCopy = angular.copy($scope.org);
-            }, function() {
-                toaster.pop('error', '注册情况加载失败');
+                    Organization.getByUuid({uuid : $scope.userUU}, {}, function(data) {//10041558
+                        if (typeof data.id == 'undefined') {
+                            return;
+                        }
+
+                        $scope.org = data;
+                        orgCopy = angular.copy($scope.org);
+                    }, function() {
+                        toaster.pop('error', '注册情况加载失败');
+                    });
+                }
+                if (data == null || !data.content) {
+                    //$scope.isAuthed = false;
+                    AuthenticationService.redirectSignin();
+                }
             });
             });
 
 
             // 获取地址信息
             // 获取地址信息
@@ -774,6 +809,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
                         $location.path('charityCertificationStep2');
                         $location.path('charityCertificationStep2');
                     }
                     }
                 } else {
                 } else {
+                    org.uuid = $scope.userUU;
                     org.type = orgType;//机构类别(1:公募 2:非公募)
                     org.type = orgType;//机构类别(1:公募 2:非公募)
                     //var file = $scope.myFiles, file = file && file.length > 0 ? file[0] : null;// 可以不传附件
                     //var file = $scope.myFiles, file = file && file.length > 0 ? file[0] : null;// 可以不传附件
                     $http({
                     $http({
@@ -814,16 +850,26 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
     /**
     /**
      * 机构认证第二步
      * 机构认证第二步
      */
      */
-    app.controller('CertificationStep2Ctrl', ['$scope', 'BaseService', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization',
-        function ($scope, BaseService, $http, $rootScope, $timeout, $location, toaster, Organization) {
+    app.controller('CertificationStep2Ctrl', ['$scope', 'BaseService', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization', 'AuthenticationService',
+        function ($scope, BaseService, $http, $rootScope, $timeout, $location, toaster, Organization, AuthenticationService) {
 
 
             var orgCopy;
             var orgCopy;
             // 获取当前账户注册机构情况
             // 获取当前账户注册机构情况
-            Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041558
-                $scope.org = data;
-                orgCopy = angular.copy($scope.org);
-            }, function() {
-                toaster.pop('error', '注册情况加载失败');
+            AuthenticationService.getAuthentication().success(function (data) {
+                if (data.content) {
+                    $scope.userUU = data.content.userUU;
+
+                    Organization.getByUuid({uuid : $scope.userUU}, {}, function(data) {//10041558
+                        $scope.org = data;
+                        orgCopy = angular.copy($scope.org);
+                    }, function() {
+                        toaster.pop('error', '注册情况加载失败');
+                    });
+                }
+                if (data == null || !data.content) {
+                    //$scope.isAuthed = false;
+                    AuthenticationService.redirectSignin();
+                }
             });
             });
 
 
             //提交
             //提交
@@ -874,24 +920,35 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
     /**
     /**
      * 机构认证第三步
      * 机构认证第三步
      */
      */
-    app.controller('CertificationStep3Ctrl', ['$scope', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization', 'BaseService',
-        function ($scope, $http, $rootScope, $timeout, $location, toaster, Organization, BaseService) {
+    app.controller('CertificationStep3Ctrl', ['$scope', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization', 'BaseService', 'AuthenticationService',
+        function ($scope, $http, $rootScope, $timeout, $location, toaster, Organization, BaseService, AuthenticationService) {
             var orgCopy;
             var orgCopy;
             // 获取当前账户注册机构情况
             // 获取当前账户注册机构情况
-            Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041558
-                if (typeof data.id == 'undefined') {
-                    return;
-                }
-                $scope.org = data;
-                $scope.logoUrl = $scope.org.logo;
-                $scope.personCertificateUrl = $scope.org.personCertificate;
-                $scope.donateCertificateUrl = $scope.org.donateCertificate;
-                $scope.legalIdCardUrl = $scope.org.legalIdCard;
+            AuthenticationService.getAuthentication().success(function (data) {
+                if (data.content) {
+                    $scope.userUU = data.content.userUU;
 
 
-                orgCopy = angular.copy($scope.org);
-            }, function() {
-                toaster.pop('error', '注册情况加载失败');
+                    Organization.getByUuid({uuid : $scope.userUU}, {}, function(data) {//10041558
+                        if (typeof data.id == 'undefined') {
+                            return;
+                        }
+                        $scope.org = data;
+                        $scope.logoUrl = $scope.org.logo;
+                        $scope.personCertificateUrl = $scope.org.personCertificate;
+                        $scope.donateCertificateUrl = $scope.org.donateCertificate;
+                        $scope.legalIdCardUrl = $scope.org.legalIdCard;
+
+                        orgCopy = angular.copy($scope.org);
+                    }, function() {
+                        toaster.pop('error', '注册情况加载失败');
+                    });
+                }
+                if (data == null || !data.content) {
+                    //$scope.isAuthed = false;
+                    AuthenticationService.redirectSignin();
+                }
             });
             });
+
             if (angular.isUndefined($scope.org)) {
             if (angular.isUndefined($scope.org)) {
                 $scope.org = {};
                 $scope.org = {};
             }
             }
@@ -1115,22 +1172,32 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
     /**
     /**
      * 公募机构认证第四步
      * 公募机构认证第四步
      */
      */
-    app.controller('PublicCertificationStep4Ctrl', ['$scope', 'BaseService', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization',
-        function ($scope, BaseService, $http, $rootScope, $timeout, $location, toaster, Organization) {
+    app.controller('PublicCertificationStep4Ctrl', ['$scope', 'BaseService', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization', 'AuthenticationService',
+        function ($scope, BaseService, $http, $rootScope, $timeout, $location, toaster, Organization, AuthenticationService) {
 
 
             var orgCopy;
             var orgCopy;
             // 获取当前账户注册机构情况
             // 获取当前账户注册机构情况
-            Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041166  10041558
-                if (typeof data.id == 'undefined') {
-                    return;
-                }
-                $scope.org = data;
-                $scope.materialUrl = $scope.org.material;
-                $scope.certifyUrl = $scope.org.certify;
+            AuthenticationService.getAuthentication().success(function (data) {
+                if (data.content) {
+                    $scope.userUU = data.content.userUU;
 
 
-                orgCopy = angular.copy($scope.org);
-            }, function() {
-                toaster.pop('error', '注册情况加载失败');
+                    Organization.getByUuid({uuid : $scope.userUU}, {}, function(data) {//10041166  10041558
+                        if (typeof data.id == 'undefined') {
+                            return;
+                        }
+                        $scope.org = data;
+                        $scope.materialUrl = $scope.org.material;
+                        $scope.certifyUrl = $scope.org.certify;
+
+                        orgCopy = angular.copy($scope.org);
+                    }, function() {
+                        toaster.pop('error', '注册情况加载失败');
+                    });
+                }
+                if (data == null || !data.content) {
+                    //$scope.isAuthed = false;
+                    AuthenticationService.redirectSignin();
+                }
             });
             });
 
 
             if (angular.isUndefined($scope.org)) {
             if (angular.isUndefined($scope.org)) {

+ 1 - 1
donate-console/src/main/webapp/resources/view/user/charityCertification1.html

@@ -509,7 +509,7 @@
                                 </div>
                                 </div>
                                     <div class="form-group clearfix">
                                     <div class="form-group clearfix">
                                         <label for="" class="fl control-label">优软账号</label>
                                         <label for="" class="fl control-label">优软账号</label>
-                                        <input required type="text" name="orgUuid" class="fl form-control" ng-maxlength="15" placeholder="请输入企业UU号" ng-model="org.uuid">
+                                        <input required type="text" name="orgUuid" class="fl form-control" ng-maxlength="15" placeholder="请输入企业UU号" value="{{userUU}}" readonly><!--ng-model="org.uuid"-->
 
 
                                         <span class="error" ng-show="submited && charityCertification1.orgUuid.$error.required">*优软账号不能为空</span>
                                         <span class="error" ng-show="submited && charityCertification1.orgUuid.$error.required">*优软账号不能为空</span>
                                         <span class="error" ng-show="submited && charityCertification1.orgUuid.$error.maxlength">*请填写正确的账号</span>
                                         <span class="error" ng-show="submited && charityCertification1.orgUuid.$error.maxlength">*请填写正确的账号</span>

+ 2 - 1
donate-console/src/main/webapp/resources/view/user/charityCertification3.html

@@ -619,9 +619,10 @@
                             </div>
                             </div>
                             <div class="form-group clearfix">
                             <div class="form-group clearfix">
                                 <label for="" class="fl control-label">银行账号</label>
                                 <label for="" class="fl control-label">银行账号</label>
-                                <input type="text" class="fl form-control" name="orgAccount" ng-model="org.account" required="true" ng-change="getBankName({{org.account}})">
+                                <input type="text" class="fl form-control" name="orgAccount" ng-model="org.account" ng-pattern="/^[0-9]*$/" required="true" ng-change="getBankName({{org.account}})">
 
 
                                 <span class="error" ng-show="submited && charityCertification3.orgAccount.$error.required">*银行账号不能为空</span>
                                 <span class="error" ng-show="submited && charityCertification3.orgAccount.$error.required">*银行账号不能为空</span>
+                                <span class="error" ng-show="submited && charityCertification3.orgAccount.$error.pattern">*请输入正确的银行账号</span>
                             </div>
                             </div>
                             <div class="form-group clearfix">
                             <div class="form-group clearfix">
                                 <label for="" class="fl control-label">开户银行支行</label>
                                 <label for="" class="fl control-label">开户银行支行</label>

+ 1 - 1
donate-console/src/main/webapp/resources/view/user/publicOfferingCertification1.html

@@ -544,7 +544,7 @@
                             </div>
                             </div>
                             <div class="form-group clearfix">
                             <div class="form-group clearfix">
                                 <label for="" class="fl control-label">优软账号</label>
                                 <label for="" class="fl control-label">优软账号</label>
-                                <input required type="text" name="orgUuid" class="fl form-control" ng-maxlength="15" placeholder="请输入企业UU号" ng-model="org.uuid">
+                                <input required type="text" name="orgUuid" class="fl form-control" ng-maxlength="15" placeholder="请输入企业UU号" value="{{userUU}}" readonly><!--ng-model="org.uuid"-->
 
 
                                 <span class="error" ng-show="submited && publicOfferingCertification1.orgUuid.$error.required">*优软账号不能为空</span>
                                 <span class="error" ng-show="submited && publicOfferingCertification1.orgUuid.$error.required">*优软账号不能为空</span>
                                 <span class="error" ng-show="submited && publicOfferingCertification1.orgUuid.$error.maxlength">*请填写正确的账号</span>
                                 <span class="error" ng-show="submited && publicOfferingCertification1.orgUuid.$error.maxlength">*请填写正确的账号</span>

+ 2 - 1
donate-console/src/main/webapp/resources/view/user/publicOfferingCertification3.html

@@ -634,9 +634,10 @@
                             </div>
                             </div>
                             <div class="form-group clearfix">
                             <div class="form-group clearfix">
                                 <label for="" class="fl control-label">银行账号</label>
                                 <label for="" class="fl control-label">银行账号</label>
-                                <input type="text" class="fl form-control" name="orgAccount" ng-model="org.account" required="true" ng-change="getBankName({{org.account}})">
+                                <input type="text" class="fl form-control" name="orgAccount" ng-model="org.account" ng-pattern="/^[0-9]*$/" required="true" ng-change="getBankName({{org.account}})">
 
 
                                 <span class="error" ng-show="submited && publicOfferingCertification3.orgAccount.$error.required">*银行账号不能为空</span>
                                 <span class="error" ng-show="submited && publicOfferingCertification3.orgAccount.$error.required">*银行账号不能为空</span>
+                                <span class="error" ng-show="submited && publicOfferingCertification3.orgAccount.$error.pattern">*请输入正确的银行账号</span>
                             </div>
                             </div>
                             <div class="form-group clearfix">
                             <div class="form-group clearfix">
                                 <label for="" class="fl control-label">开户银行支行</label>
                                 <label for="" class="fl control-label">开户银行支行</label>