浏览代码

accountType取数据库实际值

jinxia.mo 1 周之前
父节点
当前提交
ccb893a9ea

+ 13 - 13
ie-admin/src/main/java/com/ruoyi/web/controller/front/UserController.java

@@ -248,19 +248,19 @@ public class UserController extends BaseController {
             ajax.put("appConfig", json);
             ajax.put("appConfig", json);
         }
         }
 
 
-        if (null!=user.getCardId()){
-            user.setAccountType(AccountType.common.getValue());
-        }else {
-            user.setAccountType(AccountType.audit.getValue());
-        }
-
-        //处理accountType。1正常,2审核账号 user.data.accountType=2
-        String auditAccount = configService.selectConfigByKey("audit.account");
-        if (StringUtils.isNotBlank(auditAccount)){
-            if (auditAccount.contains(user.getPhonenumber())||auditAccount.contains(user.getUserName())){
-                user.setAccountType(AccountType.audit.getValue());
-            }
-        }
+//        if (null!=user.getCardId()){
+//            user.setAccountType(AccountType.common.getValue());
+//        }else {
+//            user.setAccountType(AccountType.audit.getValue());
+//        }
+//
+//        //处理accountType。1正常,2审核账号 user.data.accountType=2
+//        String auditAccount = configService.selectConfigByKey("audit.account");
+//        if (StringUtils.isNotBlank(auditAccount)){
+//            if (auditAccount.contains(user.getPhonenumber())||auditAccount.contains(user.getUserName())){
+//                user.setAccountType(AccountType.audit.getValue());
+//            }
+//        }
 
 
         return ajax;
         return ajax;
     }
     }

+ 6 - 2
ie-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="remark"        column="remark"          />
         <result property="remark"        column="remark"          />
 		<result property="userType"        column="user_type"          />
 		<result property="userType"        column="user_type"          />
 		<result property="userTypeId"        column="user_type_id"          />
 		<result property="userTypeId"        column="user_type_id"          />
+		<result property="accountType"        column="account_type"          />
         <association property="dept"     javaType="SysDept"         resultMap="deptResult" />
         <association property="dept"     javaType="SysDept"         resultMap="deptResult" />
         <collection  property="roles"    javaType="java.util.List"  resultMap="RoleResult" />
         <collection  property="roles"    javaType="java.util.List"  resultMap="RoleResult" />
     </resultMap>
     </resultMap>
@@ -61,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
 	<sql id="selectUserVo">
 	<sql id="selectUserVo">
         select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.pwd_update_date, u.create_by, u.create_time, u.remark,
         select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.pwd_update_date, u.create_by, u.create_time, u.remark,
-		u.location,u.exam_type,u.reg_status,u.end_year,u.invite_code,u.scores,u.select_subject,u.directed_study,u.eval_counts,u.card_id,
+		u.location,u.exam_type,u.reg_status,u.end_year,u.invite_code,u.scores,u.select_subject,u.directed_study,u.eval_counts,u.card_id,u.account_type,
         d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
         d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
         r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status, u.user_type, u.user_type_id
         r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status, u.user_type, u.user_type_id
         from sys_user u
         from sys_user u
@@ -71,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
     </sql>
 
 
     <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
     <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
-		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader, u.user_type, u.user_type_id from sys_user u
+		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader, u.user_type, u.user_type_id, u.account_type from sys_user u
 		left join sys_dept d on u.dept_id = d.dept_id
 		left join sys_dept d on u.dept_id = d.dept_id
 		where u.del_flag = '0'
 		where u.del_flag = '0'
 		<if test="userId != null and userId != 0">
 		<if test="userId != null and userId != 0">
@@ -198,6 +199,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="remark != null and remark != ''">remark,</if>
  			<if test="remark != null and remark != ''">remark,</if>
 		    <if test="userType != null and userType != ''">user_type,</if>
 		    <if test="userType != null and userType != ''">user_type,</if>
 		    <if test="userTypeId != null">user_type_id,</if>
 		    <if test="userTypeId != null">user_type_id,</if>
+		    <if test="accountType != null">account_type,</if>
  			create_time
  			create_time
  		)values(
  		)values(
  			<if test="userId != null and userId != ''">#{userId},</if>
  			<if test="userId != null and userId != ''">#{userId},</if>
@@ -226,6 +228,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
 		    <if test="userType != null">#{userType},</if>
 		    <if test="userType != null">#{userType},</if>
 		    <if test="userTypeId != null">#{userTypeId},</if>
 		    <if test="userTypeId != null">#{userTypeId},</if>
+		    <if test="accountType != null">#{accountType},</if>
  			sysdate()
  			sysdate()
  		)
  		)
 	</insert>
 	</insert>
@@ -258,6 +261,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			<if test="remark != null">remark = #{remark},</if>
  			<if test="remark != null">remark = #{remark},</if>
 			<if test="userTypeId != null">user_type_id = #{userTypeId},</if>
 			<if test="userTypeId != null">user_type_id = #{userTypeId},</if>
+			<if test="accountType != null">accountType = #{accountType},</if>
  			update_time = sysdate()
  			update_time = sysdate()
  		</set>
  		</set>
  		where user_id = #{userId}
  		where user_id = #{userId}