Browse Source

人才招聘功能更新,测试问题处理

hejq 8 years ago
parent
commit
72b73e0f6b

+ 1 - 1
src/main/java/com/uas/platform/home/controller/UuzcController.java

@@ -42,7 +42,7 @@ public class UuzcController extends BaseController {
                 UuzcUserInfo info = getUserInfo(user, true);
                 map.put("ishr", true);
                 map.put("user", info);
-                map.put("usertype", "company");
+                map.put("usertype", "hr");
             } else {
                 //先判断个人账户类型
                 String personalUrl = "http://job.uuzcc.com/index.php?m=&c=ubtob&a=check_user&uc_uid=" + user.getDialectUID();

+ 38 - 36
src/main/webapp/resources/js/common/common.js

@@ -83,6 +83,31 @@ function logoutUuzcJob() {
     });
 }
 
+
+/**
+ * 点击顶部导航栏跳转到人才招聘
+ */
+function jobUuzc() {
+    var url = 'http://job.uuzcc.com/';
+    var loginUrl = 'http://job.uuzcc.com/index.php?m=&c=ubtob&a=login';
+    $.get('uuzc/account/check', function(data) {
+        var user = data.user;
+        if(data.usertype == 'company' && !data.ishr) {// 如果是企业账号并且未设置hr账号,停留在当前页,其他的都跳转到人才招聘页
+            if(data.hr) {// 如果企业存在hr账号,直接跳转
+                loginJobUuzc(user, loginUrl, data.usertype);
+                setTimeout(window.location.href = url, 200);
+            } else {
+                return;
+            }
+        } else if(null != data && null != data.usertype) {
+            loginJobUuzc(user, loginUrl, data.usertype);
+            setTimeout(window.location.href = url, 200);
+        } else {
+            window.location.href = url;
+        }
+    });
+}
+
 /**
  * 链接到优软众创人才招聘(招聘入口)
  */
@@ -101,12 +126,14 @@ function jobUuzcGet() {
                 loginJobUuzc(user, loginUrl, 'company');
                 setTimeout(window.location.href = url, 200);
             } else {// 非hr
-                if(data.manager) {// 管理员才能进行设置操作
-                    if(!data.hr) {// 没有hr账号先设置hr
+                if(!data.hr) {// 企业不存在hr账号
+                    if(data.manager) {// 管理员停留设置hr
                         window.location.href = window.location.origin + window.location.pathname + "setHrAccount";
+                    } else {
+                        toastr.info('请通知管理员' + data.managerName + '设置HR账号');
                     }
-                } else {
-                    toastr.info('请通知管理员' + data.managerName + '设置HR账号')
+                } else {// 如果企业存在hr
+                    toastr.info('您的账号非HR账号,不可进行此操作');
                 }
             }
         } else {
@@ -115,30 +142,6 @@ function jobUuzcGet() {
     });
 }
 
-/**
- * 点击顶部导航栏跳转到人才招聘
- */
-function jobUuzc() {
-    var url = 'http://job.uuzcc.com/';
-    var loginUrl = 'http://job.uuzcc.com/index.php?m=&c=ubtob&a=login';
-    $.get('uuzc/account/check', function(data) {
-        var user = data.user;
-        if(data.usertype == 'company' && !data.ishr) {// 如果是企业账号并且未设置hr账号,停留在当前页,其他的都跳转到人才招聘页
-           if(data.hr) {
-               loginJobUuzc(user, loginUrl, data.usertype);
-               setTimeout(window.location.href = url, 200);
-           } else {
-               return;
-           }
-        } else if(null != data && null != data.usertype) {
-            loginJobUuzc(user, loginUrl, data.usertype);
-            setTimeout(window.location.href = url, 200);
-        } else {
-            window.location.href = url;
-        }
-    });
-}
-
 /**
  * 人才招聘求职入口
  */
@@ -176,7 +179,7 @@ function loginJobUuzc(user, url, type) {
     $('#mobile').val(user.mobile);
     $('#uc_uid').val(user.uc_uid);
     $('#salt').val(user.salt);
-    if(type == 'company') {
+    if(type == 'hr') {// 只有hr会带出当前企业的信息
         $('#companyname').val(user.companyname);
         $('#license').val(user.license);
         $('#website').val(user.website);
@@ -202,17 +205,16 @@ function addHrAccount() {
         async: false,
         success: function(data) {
            if(data) {
-               console.log(data);
                var result = data.result;
                if(result == 'success') {
                    toastr.success('设置HR账号成功');
-                   window.location.href = 'http://www.ubtob.com/#/uuzcJob';
+                   setTimeout(window.location.href = 'http://www.ubtob.com/#/uuzcJob', 200);
                }
                if(result == 'exist') {
-                   toastr.info('该企业hr账号已存在');
+                   toastr.info('该企业HR账号已存在');
                }
                if(result == 'setFailure') {
-                   toastr.error('设置hr账号失败');
+                   toastr.error('设置HR账号失败');
                }
            }
         },
@@ -242,13 +244,13 @@ function setHrAccount() {
                 var result = data.result;
                 if(result == 'success') {
                     toastr.success('设置HR账号成功');
-                    window.location.href = 'http://www.ubtob.com/#/uuzcJob';
+                    setTimeout(window.location.href = 'http://www.ubtob.com/#/uuzcJob', 200);
                 }
                 if(result == 'exist') {
-                    toastr.info('该企业hr账号已存在');
+                    toastr.info('该企业HR账号已存在');
                 }
                 if(result == 'setFailure') {
-                    toastr.error('设置hr账号失败');
+                    toastr.error('设置HR账号失败');
                 }
             }
         },