wangli 4 anni fa
parent
commit
4a6b0fd255

+ 2 - 0
user_auth/src/main/java/com/huaxu/entity/LoginLog.java

@@ -24,6 +24,8 @@ public class LoginLog implements Serializable {
     @ApiModelProperty(value = "")
     private String phone;
     @ApiModelProperty(value = "")
+    private String tenantId;
+    @ApiModelProperty(value = "")
     private Integer companyId;
     @ApiModelProperty(value = "")
     private Integer departmentId;

+ 1 - 0
user_auth/src/main/java/com/huaxu/service/impl/UserServiceImpl.java

@@ -299,6 +299,7 @@ public class UserServiceImpl implements UserService {
         LoginLog loginLog=new LoginLog();
         loginLog.setName(loginUser.getName());
         loginLog.setPhone(loginUser.getPhoneNumber());
+        loginLog.setTenantId(loginUser.getTenantId());
         loginLog.setCompanyId(loginUser.getCompanyId());
         loginLog.setDepartmentId(loginUser.getDepartmentId());
         loginLog.setType(type);

+ 4 - 4
user_auth/src/main/resources/mapper/LoginLogMapper.xml

@@ -68,17 +68,17 @@
 
     <!-- 新增所有列 -->
     <insert id="insert" keyProperty="id" useGeneratedKeys="true">
-        insert into uims_login_log(id, name, phone, company_id, department_id, type, create_time, login_ip)
-        values ( #{id}, #{name}, #{phone}, #{companyId}, #{departmentId}, #{type}, #{createTime}, #{loginIp})
+        insert into uims_login_log(id, tenant_id, name, phone, company_id, department_id, type, create_time, login_ip)
+        values ( #{id}, #{tenantId}, #{name}, #{phone}, #{companyId}, #{departmentId}, #{type}, #{createTime}, #{loginIp})
     </insert>
 
     <!-- 批量新增 -->
     <insert id="batchInsert">
-        insert into uims_login_log(id, name, phone, company_id, department_id, type, create_time, login_ip)
+        insert into uims_login_log(id, tenant_id,name, phone, company_id, department_id, type, create_time, login_ip)
         values
         <foreach collection="loginLogs" item="item" index="index" separator=",">
             (
-            #{item.id}, #{item.name}, #{item.phone}, #{item.companyId}, #{item.departmentId}, #{item.type},
+            #{item.id}, #{item.tenantId}, #{item.name}, #{item.phone}, #{item.companyId}, #{item.departmentId}, #{item.type},
             #{item.createTime}, #{item.loginIp} )
         </foreach>
     </insert>

+ 2 - 1
user_center/src/main/java/com/huaxu/service/impl/TenantServiceImpl.java

@@ -194,7 +194,8 @@ public class TenantServiceImpl implements TenantService {
         userEntity.setUserType("-999");//租户系统管理员
         userEntity.setRoleId(role.getId().longValue()); //赋值角色
         userEntity.setCompanyOrgId(org.getId().longValue());//公司
-        userEntity.setDeptOrgId(org.getId().longValue());//机构
+//        userEntity.setDeptOrgId(org.getId().longValue());//机构
+        userEntity.setEnableState("1");
         userMapper.insert(userEntity);
 
         UserRoleEntity userRoleEntity = new UserRoleEntity();

+ 6 - 4
user_center/src/main/resources/mapper/LoginLogMapper.xml

@@ -8,6 +8,7 @@
         <result property="name" column="name" jdbcType="VARCHAR"/>
         <result property="phone" column="phone" jdbcType="VARCHAR"/>
         <result property="companyId" column="company_id" jdbcType="INTEGER"/>
+        <result property="tenantId" column="tenant_id" jdbcType="INTEGER"/>
         <result property="departmentId" column="DEPARTMENT_ID" jdbcType="INTEGER"/>
         <result property="type" column="type" jdbcType="VARCHAR"/>
         <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
@@ -21,6 +22,7 @@
         a.id,
         a.name,
         a.phone,
+        a.tenant_id,
         a.company_id,
         a.DEPARTMENT_ID,
         a.type,
@@ -93,15 +95,15 @@
     </select>
     <!-- 新增所有列 -->
     <insert id="insert" keyProperty="id" useGeneratedKeys="true">
-        insert into uims_login_log( name, phone, company_id, DEPARTMENT_ID, type, create_time, login_ip)
-        values (  #{name}, #{phone}, #{companyId}, #{departmentId}, #{type}, #{createTime}, #{loginIp})
+        insert into uims_login_log( name, tenant_id,phone, company_id, DEPARTMENT_ID, type, create_time, login_ip)
+        values (  #{name}, #{tenantId},#{phone}, #{companyId}, #{departmentId}, #{type}, #{createTime}, #{loginIp})
     </insert>
     <!-- 批量新增 -->
     <insert id="batchInsert">
-        insert into uims_login_log( name, phone, company_id, DEPARTMENT_ID, type, create_time, login_ip)
+        insert into uims_login_log( name, tenant_id,phone, company_id, DEPARTMENT_ID, type, create_time, login_ip)
         values
         <foreach collection="loginLogs" item="item" index="index" separator=",">
-            ( #{item.name}, #{item.phone}, #{item.companyId}, #{item.departmentId}, #{item.type},
+            ( #{item.name}, #{item.tenantId},#{item.phone}, #{item.companyId}, #{item.departmentId}, #{item.type},
             #{item.createTime}, #{item.loginIp} )
         </foreach>
     </insert>

+ 6 - 4
user_center/src/main/resources/mapper/OperateLogMapper.xml

@@ -8,6 +8,7 @@
         <result property="id" column="ID" jdbcType="BIGINT"/>
         <result property="userName" column="USER_NAME" jdbcType="VARCHAR"/>
         <result property="phone" column="PHONE" jdbcType="VARCHAR"/>
+        <result property="tenantId" column="tenant_id" jdbcType="VARCHAR"/>
         <result property="companyId" column="COMPANY_ID" jdbcType="INTEGER"/>
         <result property="departmentId" column="DEPARTMENT_ID" jdbcType="INTEGER"/>
         <result property="operateContent" column="OPERATE_CONTENT" jdbcType="VARCHAR"/>
@@ -21,6 +22,7 @@
         a.id,
         a.USER_NAME,
         a.phone,
+        a.tenant_id,
         a.company_id,
         a.DEPARTMENT_ID,
         a.operate_content,
@@ -91,15 +93,15 @@
     </select>
     <!-- 新增所有列 -->
     <insert id="insert" keyProperty="id" useGeneratedKeys="true">
-        insert into uims_opr_log( USER_NAME, phone, company_id, DEPARTMENT_ID, operate_content, create_time, operate_parameter)
-        values ( #{userName}, #{phone}, #{companyId}, #{departmentId}, #{operateContent}, #{createTime}, #{operateParameter})
+        insert into uims_opr_log( USER_NAME, tenant_id, phone, company_id, DEPARTMENT_ID, operate_content, create_time, operate_parameter)
+        values ( #{userName}, #{tenantId}, #{phone}, #{companyId}, #{departmentId}, #{operateContent}, #{createTime}, #{operateParameter})
     </insert>
     <!-- 批量新增 -->
     <insert id="batchInsert">
-        insert into uims_opr_log( USER_NAME, phone, company_id, DEPARTMENT_ID, operate_content, create_time, operate_parameter )
+        insert into uims_opr_log( USER_NAME, tenant_id,phone, company_id, DEPARTMENT_ID, operate_content, create_time, operate_parameter )
         values
         <foreach collection="loginLogs" item="item" index="index" separator=",">
-            ( #{item.userName}, #{item.phone}, #{item.companyId}, #{item.departmentId}, #{item.operateContent},
+            ( #{item.userName}, #{item.tenantId},#{item.phone}, #{item.companyId}, #{item.departmentId}, #{item.operateContent},
             #{item.createTime}, #{item.operateParameter})
         </foreach>
     </insert>