Browse Source

新增备注

anderx 4 months ago
parent
commit
39fc090a38

+ 9 - 0
src/main/java/com/goafanti/admin/service/impl/NewAdminServiceImpl.java

@@ -210,21 +210,30 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 	}
 
 
+	/**
+	 * 用户角色类型
+	 * 用在发起公出判定能否,其他位置待补充
+	 */
 	private int sumType(List<String > roleIds) {
+		//其他角色就是0=其他
 		int type=0;
 		for (String roleId : roleIds) {
 			Role r=userRoleMapper.selectById(roleId);
 			String rt=r.getRoleType().toString();
+			//咨询角色设置成咨询
 			if (rt.equals(AFTConstants.TECH)||rt.equals(AFTConstants.TECH_MANAGER)||rt.equals(AFTConstants.TECH_ADMIN)){
 				type=3;
 				break;
+			//营销角色设置成咨询
 			} else if (rt.equals(AFTConstants.SALESMAN)||rt.equals(AFTConstants.SALESMAN_MANAGER)||rt.equals(AFTConstants.SALESMAN_ADMIN)){
 				type=1;
 				break;
+			//财务角色设置成咨询
 			}else if (rt.equals(AFTConstants.FINANCE)||rt.equals(AFTConstants.FINANCE_MANAGER)||rt.equals(AFTConstants.FINANCE_ADMIN)){
 				type=2;
 				break;
 			}
+
 		}
 		return type;
 	}

+ 5 - 6
src/main/java/com/goafanti/core/shiro/token/TokenManager.java

@@ -1,16 +1,14 @@
 package com.goafanti.core.shiro.token;
 
-import java.util.UUID;
-
-import com.goafanti.common.model.AmbSystem;
-import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.session.Session;
-
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.AftUser;
 import com.goafanti.common.model.User;
 import com.goafanti.common.utils.SpringContextUtils;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.session.Session;
+
+import java.util.UUID;
 
 public class TokenManager {
 	private static final String		CSRF_TOKEN	= "CSRF_TOKEN";
@@ -189,6 +187,7 @@ public class TokenManager {
 	public static Admin manageLogin(Admin admin, Boolean rememberMe) {
 		ShiroToken token = new ShiroToken(admin.getMobile(), admin.getPassword());
 		token.setRememberMe(null == rememberMe ? false : rememberMe);
+		//doGetAuthenticationInfo
 		SecurityUtils.getSubject().login(token);
 		return getAdminToken();
 	}