فهرست منبع

优软云关于人才招聘功能的一些调整

hejq 8 سال پیش
والد
کامیت
12d0a7ed4a

+ 5 - 6
src/main/java/com/uas/platform/home/controller/AccountController.java

@@ -1,16 +1,15 @@
 package com.uas.platform.home.controller;
 
-import java.io.IOException;
-
+import com.uas.platform.home.core.support.SystemSession;
+import com.uas.platform.home.web.BaseController;
+import com.uas.sso.SSOHelper;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
 
-import com.uas.platform.home.core.support.SystemSession;
-import com.uas.platform.home.web.BaseController;
-import com.uas.sso.SSOHelper;
+import java.io.IOException;
 
 @Controller
 public class AccountController extends BaseController {
@@ -49,5 +48,5 @@ public class AccountController extends BaseController {
 		SSOHelper.clearLogin(request, response);
 		return success();
 	}
-
+    
 }

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

@@ -49,7 +49,7 @@ public class UuzcController extends BaseController {
                 String result = AccountUtils.getHrAccount(info.getLicense());
                 ResultInfo resInfo = JSONObject.parseObject(result, ResultInfo.class);
                 map.put("hr", resInfo.getExistHr() ? true : false);
-                if(user.getName().equals(user.getUuzcUserSpaceDetail().getAdminName())) {
+                if(user.getUid().equals(user.getUuzcUserSpaceDetail().getAdminTel())) {
                     map.put("manager", true);
                 } else {
                     map.put("managerName", user.getUuzcUserSpaceDetail().getAdminName());
@@ -128,4 +128,15 @@ public class UuzcController extends BaseController {
         return success(users);
     }
 
+    /**
+     * 获取当前企业的hr账号信息
+     *
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping(value = "/hrInfo", method = RequestMethod.GET)
+    public ModelMap getHrInfo() throws Exception {
+        User user = AccountUtils.getHrInfo(SystemSession.getUser().getSpaceUID());
+        return new ModelMap("user", user);
+    }
 }

+ 3 - 7
src/main/resources/conf/account.properties

@@ -1,17 +1,13 @@
 ### sso config
 sso.app=home
-# token secretkey
+token secretkey
 sso.secretkey=0taQcW073Z7G628g5H
 sso.cookie.secure=false
 
-#ŐýĘ˝
-sso.cookie.domain=.ubtob.com
+#prod
+sso.cookie.domain=ubtob.com
 sso.login.url=https://account.ubtob.com/sso/login
 
-#ąžľŘ
-#sso.cookie.domain=:8080/home
-#sso.login.url=http://hejq.ubtob.com:8090/account/sso/login
-
 ### account center config,
 account.us.save.url=http://10.10.100.133:8080/api/userspace
 account.user.save.url=http://10.10.100.133:8080/api/user

+ 4 - 1
src/main/webapp/WEB-INF/views/normal/index.html

@@ -27,6 +27,7 @@ var _hmt = _hmt || [];
   hm.src = "//hm.baidu.com/hm.js?ab3516f4a7187fa5ac0e449c7db9f195";
   var s = document.getElementsByTagName("script")[0]; 
   s.parentNode.insertBefore(hm, s);
+
 })();
 </script>
 </head>
@@ -207,7 +208,9 @@ var _hmt = _hmt || [];
 								</p>
 							</div>
 							<div class="header-btn">
-								<a href="#" class="link-job-get">我要招人</a><a href="#" class="link-job-post">我要求职</a>
+								<a href="#" class="link-job-get">我要招人</a>
+                                <a href="#" class="link-hr-set" style="display: none">设置HR账号</a>
+                                <a href="#" class="link-job-post">我要求职</a>
 							</div>
 						</div>
 					</div>

+ 70 - 15
src/main/webapp/resources/js/common/common.js

@@ -23,7 +23,27 @@ function getAccountInfo() {
             }
 			$('.link-mall').attr('href', 'http://www.usoftmall.com/login/proxy');
 			window._hasAccountInfo = true;
-		}
+			var user = data.content;
+			// 管理员
+            if(user.uid == user.uuzcUserSpaceDetail.adminTel) {
+                // 如果是hr
+                if(user.hr == 1) {
+                    $('.link-job-get').show();
+                    $('.link-hr-set').hide();
+                } else {
+                    $('.link-hr-set').show();
+                    $('.link-job-get').hide();
+                }
+            } else {// 非管理员
+                $('.link-job-get').show();
+                $('.link-hr-set').hide();
+            }
+		} else {
+		    var location = window.location.pathname;
+		    if(location.indexOf('setHrAccount') > -1) {// 如果是在设置hr页面,没有登录的话跳转到登录页面
+               login(event);
+            }
+        }
 	});
 }
 
@@ -111,6 +131,31 @@ function jobUuzc() {
     });
 }
 
+/**
+ * 存储hrInfo,不用重新加载
+ *
+ * @type {null}
+ */
+var hrInfo = null;
+
+function getHrInfo() {
+    if(hrInfo == null) {
+        $.get('uuzc/hrInfo', function(userInfo) {
+            if(null != userInfo.user)
+                hrInfo = userInfo.user;
+            // 默认给相关字段赋值
+            $('#hrname').val(hrInfo.name);
+            $('#hremail').val(hrInfo.secondUID);
+            $('#hrtel').val(hrInfo.uid);
+            $('#username').val(hrInfo.name);
+            $('#usertel').val(hrInfo.uid);
+            $('#useruu').val(hrInfo.dialectUID);
+            $('#useremail').val(hrInfo.secondUID);
+            $('#userList').css('display','none');
+        });
+    }
+}
+
 /**
  * 链接到优软众创人才招聘(招聘入口)
  */
@@ -122,14 +167,15 @@ function jobUuzcGet() {
         if(null != data && 'personal' == data.usertype) {
             toastr.error("您的账号为个人账号,不可进行此操作");
         } else if(null != data && 'company' == data.usertype) {
-            if(!data.hr) {// 企业不存在hr账号
-                if(data.manager) {// 管理员停留设置hr
+            // 先判断是否管理员
+            if(data.manager) {
+                // if(!data.hr) {// 企业不存在hr账号
                     window.location.href = window.location.origin + window.location.pathname + "setHrAccount";
-                } else {
-                    toastr.error('请通知管理员' + data.managerName + '设置HR账号');
-                }
-            } else {// 如果企业存在hr
-                toastr.error('您的账号非HR账号,不可进行此操作');
+                // } else {// 如果企业存在hr
+                //     toastr.error('您的账号非HR账号,不可进行此操作');
+                // }
+            } else {
+                toastr.error('请通知管理员' + data.managerName + '设置HR账号');
             }
         } else if(data.usertype =='hr') {
             loginJobUuzc(user, loginUrl, 'hr');
@@ -204,18 +250,19 @@ function addHrAccount() {
                var result = data.result;
                if(result == 'success') {
                    toastr.success('设置HR账号成功');
-                   setTimeout(window.location.href = 'http://www.ubtob.com/#/uuzcJob', 500);
+                   hrInfo = null; // 清空已查询的数据,重新加载
+                   setTimeout(window.location.href = 'http://www.ubtob.com/#/uuzcJob', 2000);
                }
                if(result == 'exist') {
                    toastr.error('该企业HR账号已存在');
                }
                if(result == 'setFailure') {
-                   toastr.erroror('设置HR账号失败');
+                   toastr.error('设置HR账号失败');
                }
            }
         },
         error: function (error) {
-            toastr.erroror(error);
+            toastr.error(error);
         }
     });
 }
@@ -240,7 +287,8 @@ function setHrAccount() {
                 var result = data.result;
                 if(result == 'success') {
                     toastr.success('设置HR账号成功');
-                    setTimeout(window.location.href = 'http://www.ubtob.com/#/uuzcJob', 500);
+                    hrInfo = null; // 清空已查询的数据,重新加载
+                    setTimeout(window.location.href = 'http://www.ubtob.com/#/uuzcJob', 2000);
                 }
                 if(result == 'exist') {
                     toastr.error('该企业HR账号已存在');
@@ -298,7 +346,6 @@ function getExistUser() {
                             $('#userList').css('display','none');
                         });
                     })(i)
-                    console.log(ul.height);
                 }
             }
         });
@@ -325,7 +372,9 @@ function suspendMessage() {
     toastr.error('网站正在升级中,敬请期待!');
 }
 
-
+/**
+ * 监听输入框值的变化设置联想
+ */
 $('#username').bind('input propertychange', function() {
     var nameList = [];
     $("#userList").find("li").remove();// 先清除以前的样式
@@ -379,6 +428,9 @@ $(function() {
 	
 	// 查询登录信息
 	getAccountInfo();
+
+	// 获取当前企业HR信息
+    getHrInfo();
 	
 	// 登录点击
 	$('.link-login').click(login);
@@ -392,9 +444,12 @@ $(function() {
     // 连接到众创招聘
     $('.link-job').click(jobUuzc);
 
-    // 求职
+    // 点击链接到众创人才招聘(求职)
     $('.link-job-post').click(jobUuzcPost);
 
+    // 点击链接到众创人才招聘(设置hr)
+    $('.link-hr-set').click(jobUuzcGet);
+
     // 添加hr账号(新增)
     $('#addHrAccount').click(addHrAccount);