Commit 16e74abe by 杨林龙

优化假性离线查询

1 parent 7d33a33e
...@@ -59,6 +59,9 @@ public class FakeOfflineService extends AbstractCommonService { ...@@ -59,6 +59,9 @@ public class FakeOfflineService extends AbstractCommonService {
@Autowired @Autowired
private VehicleMonitorService vehicleMonitorService; private VehicleMonitorService vehicleMonitorService;
@Autowired
private OrganizationApiService organizationApiService;
/** /**
* 查询 * 查询
* *
...@@ -237,7 +240,8 @@ public class FakeOfflineService extends AbstractCommonService { ...@@ -237,7 +240,8 @@ public class FakeOfflineService extends AbstractCommonService {
} }
// 三 获取本部门以及下级部门 // 三 获取本部门以及下级部门
Set<Long> deptIds = ShieldContextHolder.getVisibleDeptIds(); Set<Long> deptIds = organizationApiService.getAllSubOrgIds();
log.info("userId:" + ShieldContextHolder.getUserId() + ";deptIds:" + JSONUtil.toJsonStr(deptIds));
// 从白名单列表获取白名单设备号及其车架号 // 从白名单列表获取白名单设备号及其车架号
List<String> writeListVinList = whitelistSnMapper.getWriteListVin(deptIds); List<String> writeListVinList = whitelistSnMapper.getWriteListVin(deptIds);
writeListVinList.forEach(vin -> reasonMap.put(vin, FakeOfficeReasonEnum.WHITELIST.getCode())); writeListVinList.forEach(vin -> reasonMap.put(vin, FakeOfficeReasonEnum.WHITELIST.getCode()));
......
...@@ -18,7 +18,6 @@ import org.apache.commons.collections4.CollectionUtils; ...@@ -18,7 +18,6 @@ import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
...@@ -149,4 +148,11 @@ public class OrganizationApiService { ...@@ -149,4 +148,11 @@ public class OrganizationApiService {
} }
} }
} }
public Set<Long> getAllSubOrgIds() {
R<Set<Long>> dataR = organizationService.getAllSubOrgIds();
Set<Long> orgListIds = dataR.getDataList(new TypeToken<Set<Long>>() {
}.getType());
return orgListIds;
}
} }
package cn.com.glsx.admin.modules.service;
import cn.com.glsx.Application;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.Set;
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class OrganizationApiServiceTest {
@Autowired
private OrganizationApiService organizationApiService;
@Test
public void getAllSubOrgIds() {
Set<Long> allSubOrgIds = organizationApiService.getAllSubOrgIds();
System.out.println("allSubOrgIds = " + JSONUtil.toJsonStr(allSubOrgIds));
}
}
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!