anderx 4 years ago
parent
commit
815c8e6607

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

@@ -276,6 +276,8 @@ public interface UserMapper {
 
 	void updateRelease(String orderNo);
 
+	String checkRoleMax(String aid);
+
 	
 	
 }

+ 5 - 0
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -2047,6 +2047,11 @@ inner join(
 		and source in(1,2,3) and share_type=0
 	</select>
 	
+	<select id="checkRoleMax" parameterType="string" resultType="string">
+		select role_type from user_role ur left join `role` r on ur.rid =r.id
+		where ur.uid = #{aid,jdbcType=VARCHAR} order by role_type desc limit 1
+	</select>
+	
 	<select id="checkLock" parameterType="string" resultType="integer">
 		select count(*) from `user`
 		where  id= #{uid,jdbcType=VARCHAR}

+ 4 - 3
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -1860,9 +1860,10 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		int y =0;
 		int i=userMapper.checkUserMax(aid);
 		//营销员100 经理200 总监500
-		if (TokenManager.hasRole(AFTConstants.SALESMAN_DIRECTOR))y=500;
-		else if (TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER))y=200;
-		else if (TokenManager.hasRole(AFTConstants.SALESMAN))y=100;
+		String maxRole =userMapper.checkRoleMax(aid);
+		if (maxRole.equals(AFTConstants.SALESMAN_DIRECTOR))y=800;
+		else if (maxRole.equals(AFTConstants.SALESMAN_MANAGER))y=200;
+		else if (maxRole.equals(AFTConstants.SALESMAN))y=100;
 		if (i>=y) {
 			return true;
 		}

+ 6 - 6
src/main/resources/props/config_local.properties

@@ -1,13 +1,13 @@
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #本地
-#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.username=root
-#jdbc.password=123456
-#测试
-jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc\:mysql://localhost:3306/aft20210315?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 jdbc.username=root
-jdbc.password=aftdev
+jdbc.password=123456
+#测试
+#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.username=root
+#jdbc.password=aftdev
 #\u68c0\u6d4b\u6570\u636e\u5e93\u94fe\u63a5\u662f\u5426\u6709\u6548\uff0c\u5fc5\u987b\u914d\u7f6e
 jdbc.validationQuery=SELECT 'x'
 #\u521d\u59cb\u8fde\u63a5\u6570