Explorar o código

手机号码去重,企业用户不显示 我要成为顾问/法律顾问的按钮

limin %!s(int64=7) %!d(string=hai) anos
pai
achega
8e300bf09a

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

@@ -1406,6 +1406,10 @@ public class WebpageController extends BaseController {
 	@RequestMapping(value = "/portal/service/safeguarding", method = RequestMethod.GET)
 	public ModelAndView portalServiceSafeguarding(HttpServletRequest request, ModelAndView modelview){
 		//获得法律顾问列表数据
+		String id = TokenManager.getUserId();
+		if(null != id){
+			modelview.addObject("userType", userService.selectByPrimaryKey(TokenManager.getUserToken().getId()).getType());
+		}
 		modelview.addObject("slist", userIdentityService.consultantList( null, 1,  4,  null, null, null,  0,  12).getList());
 		modelview.setViewName("/portal/service/safeguarding");
 		return modelview;
@@ -1454,6 +1458,10 @@ public class WebpageController extends BaseController {
 	@RequestMapping(value = "/portal/adviser", method = RequestMethod.GET)
 	public ModelAndView portalAdviser(ModelAndView modelview){
 		modelview.setViewName("/portal/adviser");
+		String id = TokenManager.getUserId();
+		if(null != id){
+			modelview.addObject("userType", userService.selectByPrimaryKey(TokenManager.getUserToken().getId()).getType());
+		}
 		return modelview;
 	}
 	/**

+ 1 - 1
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -114,5 +114,5 @@ public interface UserMapper {
 	
 	List<JtMessageConsumer> getAllUser();
 	
-	int getCountByMobile(User user);
+	int getCountByMobile(@Param("id")String id,@Param("mobile")String mobile);
 }

+ 3 - 3
src/main/java/com/goafanti/user/controller/UserApiController.java

@@ -708,12 +708,12 @@ public class UserApiController extends BaseApiController {
 			Pattern p = Pattern.compile("^[1][3,4,5,7,8][0-9]{9}$"); // 验证手机号           
 			Matcher m = p.matcher(mobile);   
 			if(!m.matches()){
-				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"电话号码格式不对"));
+				res.getError().add(buildError(null,"电话号码格式不对","电话号码格式不对"));
 			}else{
 				//验证手机是否存在
-				int i = userService.getCountByMobile(user);
+				int i = userService.getCountByMobile(user.getId(),mobile);
 				if(i>0){
-					res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"电话号码重复"));
+					res.getError().add(buildError(null,"电话号码重复","电话号码重复"));
 				}else{
 					user.setMobile(mobile);//修改电话号码
 				}

+ 1 - 1
src/main/java/com/goafanti/user/service/UserService.java

@@ -68,6 +68,6 @@ public interface UserService {
 	 * @param user
 	 * @return
 	 */
-	int getCountByMobile(User user);
+	int getCountByMobile(String id, String mobile);
 	
 }

+ 2 - 2
src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java

@@ -243,7 +243,7 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 	}
 
 	@Override
-	public int getCountByMobile(User user) {
-		return userMapper.getCountByMobile(user);
+	public int getCountByMobile(String id,String mobile) {
+		return userMapper.getCountByMobile(id,mobile);
 	}
 }

+ 2 - 2
src/main/webapp/WEB-INF/views/portal/adviser.html

@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
-<head>
+<head  th:replace="common::header(~{::title},~{::link})">
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta http-equiv="X-UA-Compatible" content="ie=edge">
@@ -27,7 +27,7 @@
                     </span>
                 </div>
             </div>
-            <span>我要成为顾问</span>
+            <span th:if="${userType != 1}">我要成为顾问</span>
         </div>
         <div class="adviserIndexList">
             <div class="listHead listOne">

+ 1 - 1
src/main/webapp/WEB-INF/views/portal/adviser/adviserDetail.html

@@ -3,7 +3,7 @@
 	xmlns:th="http://www.thymeleaf.org"
 	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 
-<head>
+<head  th:replace="common::header(~{::title},~{::link})">
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta http-equiv="X-UA-Compatible" content="ie=edge">

+ 1 - 1
src/main/webapp/WEB-INF/views/portal/adviser/adviserList.html

@@ -2,7 +2,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml"
 	xmlns:th="http://www.thymeleaf.org"
 	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
-<head>
+<head  th:replace="common::header(~{::title},~{::link})">
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta http-equiv="X-UA-Compatible" content="ie=edge">

+ 1 - 1
src/main/webapp/WEB-INF/views/portal/service/safeguarding.html

@@ -26,7 +26,7 @@
                     </span>
                 </div>
             </div>
-            <span>我要成为法律顾问</span>
+            <span th:if="${userType != 1}">我要成为法律顾问</span>
         </div>
         <div class="safeIndexPic">
             <img th:src="${portalHost+'/img/newMenu/safeIndex_1.png'}" alt="">