Преглед изворни кода

修改用户初始数据,新增用户部门省份信息

anderx пре 1 година
родитељ
комит
66fb740657

+ 15 - 20
src/main/java/com/goafanti/common/controller/PortalController.java

@@ -1,18 +1,5 @@
 package com.goafanti.common.controller;
 
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Random;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.servlet.ModelAndView;
-import org.springframework.web.servlet.view.RedirectView;
 import com.goafanti.achievement.bo.AchievementListBo;
 import com.goafanti.achievement.bo.AchievementPartnerListBo;
 import com.goafanti.achievement.service.AchievementService;
@@ -20,11 +7,7 @@ import com.goafanti.app.bo.ProjectBo;
 import com.goafanti.app.bo.ProjectDetailBo;
 import com.goafanti.app.bo.ServiceImages;
 import com.goafanti.business.service.BusinessProjectService;
-import com.goafanti.common.enums.AchievementBargainingMode;
-import com.goafanti.common.enums.AchievementMaturity;
-import com.goafanti.common.enums.AchievementTransferMode;
-import com.goafanti.common.enums.UserLevel;
-import com.goafanti.common.enums.UserType;
+import com.goafanti.common.enums.*;
 import com.goafanti.common.service.DistrictGlossoryService;
 import com.goafanti.common.service.FieldGlossoryService;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -40,6 +23,20 @@ import com.goafanti.portal.bo.DemandPortalSimilarListBo;
 import com.goafanti.user.bo.UserPartnerDetailBo;
 import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.user.service.UserService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.view.RedirectView;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Random;
 
 @Controller
 public class PortalController extends BaseController {
@@ -52,8 +49,6 @@ public class PortalController extends BaseController {
 	@Resource
 	private UserIdentityService	userIdentityService;
 	@Resource
-	private FieldGlossoryService fieldGlossoryService;
-	@Resource
 	private DemandInterestService  demandInterestService;
 	@Resource
 	private UserService userService;

+ 0 - 52
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -4,7 +4,6 @@ import com.goafanti.achievement.service.AchievementService;
 import com.goafanti.banners.enums.BannersType;
 import com.goafanti.banners.service.BannersService;
 import com.goafanti.common.model.Banners;
-import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.demand.service.DemandService;
 import com.goafanti.news.bo.NewsPortalList;
 import com.goafanti.news.enums.NewsType;
@@ -60,57 +59,6 @@ public class WebpageController extends BaseController {
 		return modelview;
 	}
 
-	@RequestMapping(value = "/user/account/set", method = RequestMethod.GET)
-	public ModelAndView userSet(HttpServletRequest request, ModelAndView modelview) {
-		modelview.setViewName("/user/account/set");
-		return modelview;
-	}
-
-	@RequestMapping(value = "/user/account/achievement", method = RequestMethod.GET)
-	public ModelAndView userAchievement(HttpServletRequest request, ModelAndView modelview) {
-		modelview.setViewName("/user/account/achievement");
-		return modelview;
-	}
-
-	@RequestMapping(value = "/user/account/demand", method = RequestMethod.GET)
-	public ModelAndView userDemand(HttpServletRequest request, ModelAndView modelview) {
-		modelview.setViewName("/user/account/demand");
-		return modelview;
-	}
-
-	@RequestMapping(value = "/user/login", method = RequestMethod.GET)
-	public String userLogin(HttpServletRequest request, ModelAndView modelview) {
-		return "/user/login";
-	}
-
-	@RequestMapping(value = "/user/logout", method = RequestMethod.GET)
-	public String userLogout(HttpServletRequest request, ModelAndView modelview) {
-		TokenManager.logout();
-		//return userLogin(request, modelview);
-		return "redirect:/admin/login";
-	}
-
-	@RequestMapping(value = "/user/signIn", method = RequestMethod.GET)
-	public String userSignin(HttpServletRequest request, ModelAndView modelview) {
-		return "/user/signIn";
-	}
-
-	@RequestMapping(value = "/user/msignIn", method = RequestMethod.GET)
-	public String mSignin(HttpServletRequest request, ModelAndView modelview) {
-		return "/user/msignIn";
-	}
-
-	@RequestMapping(value = "/user/certify", method = RequestMethod.GET)
-	public ModelAndView userCertify(HttpServletRequest request, ModelAndView modelview) {
-		modelview.setViewName("/user/certify");
-		return modelview;
-	}
-
-	@RequestMapping(value = "/user/groupCertify", method = RequestMethod.GET)
-	public ModelAndView userGroupCertify(HttpServletRequest request, ModelAndView modelview) {
-		modelview.setViewName("/user/groupCertify");
-		return modelview;
-	}
 
 	@RequestMapping(value = "/admin/login", method = RequestMethod.GET)
 	public String adminLogin(HttpServletRequest request, ModelAndView modelview) {

+ 13 - 3
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -298,9 +298,19 @@
 
     <select id="selectByMobile" parameterType="java.lang.String" resultMap="BaseResultMap">
         select
-        <include refid="Base_Column_List" />
-        from admin
-        where mobile = #{mobile,jdbcType=VARCHAR}
+            a.id,a.mobile,a.name,
+            a.password,a.email,a.create_time,
+            a.number,b.province ,a.position,
+            a.superior_id,a.city,a.department_id,
+            a.status,a.user_no,a.duty,
+            a.district,a.head_portrait_url,a.contact_mobile,
+            a.last_login_time,a.open_id,a.type,
+            a.reviewer,a.amb_id,a.amb_role,
+            a.amb_manage,a.manager_id,a.senior_staff,
+            a.public_purview,a.expense_open_id,a.expense_super_examine
+        from admin a left join department b on a.department_id=b.id
+        left join district_glossory c on b.province=c.id
+        where a.mobile = #{mobile,jdbcType=VARCHAR}
     </select>
 
     <select id="selectRolesByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.common.model.Role">

+ 1 - 0
src/main/java/com/goafanti/common/model/AftUser.java

@@ -15,4 +15,5 @@ public interface AftUser {
 
 	Integer getType();
 
+
 }

+ 2 - 1
src/main/java/com/goafanti/common/model/User.java

@@ -1,6 +1,5 @@
 package com.goafanti.common.model;
 
-import java.io.Serializable;
 import java.util.Date;
 
 /**
@@ -539,4 +538,6 @@ public class User implements AftUser{
     public void setNewChannel(Integer newChannel) {
         this.newChannel = newChannel;
     }
+
+
 }

+ 12 - 17
src/main/java/com/goafanti/core/shiro/token/UserRealm.java

@@ -1,22 +1,5 @@
 package com.goafanti.core.shiro.token;
 
-import java.util.Set;
-
-import javax.annotation.Resource;
-
-import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.authc.AuthenticationException;
-import org.apache.shiro.authc.AuthenticationInfo;
-import org.apache.shiro.authc.AuthenticationToken;
-import org.apache.shiro.authc.SimpleAuthenticationInfo;
-import org.apache.shiro.authc.UnknownAccountException;
-import org.apache.shiro.authz.AuthorizationInfo;
-import org.apache.shiro.authz.SimpleAuthorizationInfo;
-import org.apache.shiro.realm.AuthorizingRealm;
-import org.apache.shiro.subject.PrincipalCollection;
-import org.apache.shiro.subject.SimplePrincipalCollection;
-import org.springframework.beans.factory.annotation.Autowired;
-
 import com.goafanti.admin.service.AdminService;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.AftUser;
@@ -25,6 +8,17 @@ import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.permission.service.PermissionService;
 import com.goafanti.permission.service.RoleService;
 import com.goafanti.user.service.UserService;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.authc.*;
+import org.apache.shiro.authz.AuthorizationInfo;
+import org.apache.shiro.authz.SimpleAuthorizationInfo;
+import org.apache.shiro.realm.AuthorizingRealm;
+import org.apache.shiro.subject.PrincipalCollection;
+import org.apache.shiro.subject.SimplePrincipalCollection;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.annotation.Resource;
+import java.util.Set;
 
 public class UserRealm extends AuthorizingRealm {
 	@Autowired
@@ -52,6 +46,7 @@ public class UserRealm extends AuthorizingRealm {
 		ShiroToken token = (ShiroToken) authcToken;
 		if (null == token.getType()) {
 			Admin admin = adminService.selectByMobile(token.getUsername());
+			System.out.println(admin.getProvince());
 			if (null == admin) {
 				throw new UnknownAccountException();
 			}

+ 1 - 0
src/main/webapp/WEB-INF/views/common.html

@@ -365,6 +365,7 @@
 				createTime : /*[[${adminData.createTime}]]*/'',
 				uid : /*[[${adminData.id}]]*/'',
 				departmentId : /*[[${adminData.departmentId}]]*/'',
+				province : /*[[${adminData.province}]]*/null,
 				isSuperAdmin : /*[[${shiro.hasRole('999999')}]]*/false,
 				isApprovalDecision : /*[[${shiro.hasRole('99999')}]]*/false,
 				isLegal: /*[[${shiro.hasRole('82')}]]*/false,