Explorar el Código

'优化系统访问记录-列表、系统访问记录-列表导出、操作日志记录-列表、操作日志记录-列表导出接口,增加tenantId租户Id进行隔离,测试接口'

james hace 1 año
padre
commit
897eb731af

+ 2 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysLogininforServiceImpl.java

@@ -53,6 +53,7 @@ public class SysLogininforServiceImpl extends AbstractCrudService<SysLogininforM
     @Override
     public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor)
     {
+        logininfor.setTenantId(SecurityUtils.getTenantId());
         return logininforMapper.selectLogininforList(logininfor);
     }
 
@@ -66,6 +67,7 @@ public class SysLogininforServiceImpl extends AbstractCrudService<SysLogininforM
     @DataScope(deptAlias = "d",userAlias = "d")
     public List<SysLoginExportVO> selectLogininforListExport(SysLogininfor logininfor)
     {
+        logininfor.setTenantId(SecurityUtils.getTenantId());
         return logininforMapper.selectLogininforListExport(logininfor);
     }
 

+ 2 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysOperLogServiceImpl.java

@@ -54,6 +54,7 @@ public class SysOperLogServiceImpl extends AbstractCrudService<SysOperLogMapper,
     @DataScope(deptAlias = "d",userAlias = "d")
     public List<SysOperLog> selectOperLogList(SysOperLog operLog)
     {
+        operLog.setTenantId(SecurityUtils.getTenantId());
         return operLogMapper.selectOperLogList(operLog);
     }
 
@@ -67,6 +68,7 @@ public class SysOperLogServiceImpl extends AbstractCrudService<SysOperLogMapper,
     @DataScope(deptAlias = "d",userAlias = "d")
     public List<SysOperLogExportVO> selectOperLogListExport(SysOperLog operLog)
     {
+        operLog.setTenantId(SecurityUtils.getTenantId());
         return operLogMapper.selectOperLogListExport(operLog);
     }
 

+ 6 - 0
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysLogininforMapper.xml

@@ -59,6 +59,9 @@
 			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
 				and date_format(access_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
 			</if>
+			<if test="1 == 1">
+				and tenant_id = #{tenantId}
+			</if>
 			<!-- 数据范围过滤 -->
 			${params.dataScope}
 		</where>
@@ -83,6 +86,9 @@
 			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
 				and date_format(access_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
 			</if>
+			<if test="1 == 1">
+				and tenant_id = #{tenantId}
+			</if>
 			${params.dataScope}
 		</where>
 		order by info_id desc

+ 6 - 0
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysOperLogMapper.xml

@@ -103,6 +103,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
 				and date_format(oper_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
 			</if>
+			<if test="1 == 1">
+				and tenant_id = #{tenantId}
+			</if>
 			<!-- 数据范围过滤 -->
 			${params.dataScope}
 		</where>
@@ -137,6 +140,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
 				and date_format(oper_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
 			</if>
+			<if test="1 == 1">
+				and tenant_id = #{tenantId}
+			</if>
 			<!-- 数据范围过滤 -->
 			${params.dataScope}
 		</where>