Commit e84913c8 by 杨林龙

增加权限关联

1 parent 9e01defd
......@@ -17,7 +17,6 @@ public interface TrialDriveReportMapper extends CommonBaseMapper<ElectricFenceDr
@DataPerm(showSql = true)
List<TrialDriveReportExport> getTestDrivePageList(TrialDriveReportSearch search);
@DataPerm(showSql = true)
List<TrialDriveReportExport> getEffectiveTestDriveData(TrialDriveReportSearch search);
List<String> getYearWithData();
......
......@@ -33,14 +33,6 @@ public class TrialDriveReportService {
List<String> splitList = Arrays.asList(splitArr);
search.setSplitList(splitList);
Integer rolePermissionType = ShieldContextHolder.getRolePermissionType();
//非管理员 并且 数据权限不是全部 的需要加上用户权限涉及的全部用户id
boolean superAdminFlag = ShieldContextHolder.isSuperAdmin();
if (!superAdminFlag && !UserConstants.RolePermitCastType.all.getCode().equals(rolePermissionType)) {
Set<Long> userIdList = ShieldContextHolder.getVisibleCreatorIds();
search.setUserIdList(userIdList);
}
return trialDriveReportMapper.getTestDrivePageList(search);
}
......
......@@ -32,10 +32,10 @@
tefs.sn,
tefs.vin,
tv.model_name vehicleTypeName
from t_electric_fence_sns tefs
from t_vehicle tv
inner join t_electric_fence_sns tefs on tv.vin = tefs.vin
inner join t_electric_fence tef on tef.id = tefs.fence_id
left join t_user tu on tu.id = tef.created_by
left join t_vehicle tv on tv.vin = tefs.vin
where tefs.fence_id = tef.id
and tef.biz_fence_type = 12 and tu.del_flag = 0
<if test="keywords != null and keywords!='' ">
......@@ -44,12 +44,6 @@
or tu.username like '%${keywords}%'
)
</if>
<if test="userIdList != null">
and tu.id IN
<foreach collection="userIdList" item="userId" index="index" open="(" close=")" separator=",">
#{userId}
</foreach>
</if>
<if test="splitList != null">
and tv.model_name IN
<foreach collection="splitList" item="vehicleTypeName" index="index" open="(" close=")" separator=",">
......
......@@ -3,7 +3,11 @@ package cn.com.glsx.admin.modules.service;
import cn.com.glsx.Application;
import cn.com.glsx.admin.modules.model.export.TrialDriveReportExport;
import cn.com.glsx.admin.modules.model.param.TrialDriveReportSearch;
import cn.com.glsx.usercenter.api.dto.response.Organization;
import cn.com.glsx.usercenter.api.feign.OrganizationService;
import cn.com.glsx.usercenter.api.feign.UserService;
import com.alibaba.fastjson.JSON;
import com.glsx.plat.core.web.R;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
......@@ -11,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.ArrayList;
import java.util.List;
@Slf4j
......@@ -21,6 +26,12 @@ public class TrialDriveReportServiceTest {
@Autowired
private TrialDriveReportService trialDriveReportService;
@Autowired
private OrganizationService organizationService;
@Autowired
private UserService userService;
@Test
public void search() {
TrialDriveReportSearch trialDriveReportSearch = new TrialDriveReportSearch();
......@@ -43,4 +54,14 @@ public class TrialDriveReportServiceTest {
List<String> yearWithData = trialDriveReportService.getYearWithData();
System.out.println("yearWithData = " + JSON.toJSONString(yearWithData));
}
}
\ No newline at end of file
@Test
public void test04() {
List userIdList = new ArrayList<Long>();
userIdList.add(Long.parseLong("6576"));
userIdList.add(Long.parseLong("6577"));
R<List<Organization>> listR = organizationService.getOrgsByUserIds(userIdList);
System.out.println(" = " +JSON.toJSONString(listR));
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!