|
@@ -94,6 +94,8 @@ public class WebGatewayImpl implements WebGateway {
|
|
|
private TblDicService tblDicService;
|
|
|
@Autowired
|
|
|
private TblDicItemService tblDicItemService;
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
|
|
|
@Override
|
|
|
public UploadRes uploadDev(MultipartFile file) throws IOException {
|
|
@@ -145,9 +147,13 @@ public class WebGatewayImpl implements WebGateway {
|
|
|
if (queryReq.getPageSize() == null || queryReq.getPageSize() <= 0){
|
|
|
queryReq.setPageSize(10);
|
|
|
}
|
|
|
- // 执行分页查询
|
|
|
- Page<DevInfo> devInfoPage = devInfoService.queryDevList(queryReq);
|
|
|
- // 换为目标VO
|
|
|
+
|
|
|
+ // 执行分页查询,根据tenantId是否为空来选择不同的查询方法
|
|
|
+// Page<DevInfo> devInfoPage = devInfoService.queryDevList(queryReq);
|
|
|
+ Page<DevInfo> devInfoPage = (queryReq.getTenantId() != null)
|
|
|
+ ? devInfoService.queryDevListByTenantId(queryReq)
|
|
|
+ : devInfoService.queryDevList(queryReq);
|
|
|
+ // 换为目标DTO
|
|
|
List<DeviceDTO> targets = CopyUtils.copyList(devInfoPage.getRecords(), DeviceDTO.class);
|
|
|
return CopyUtils.copyPage(devInfoPage, targets);
|
|
|
}
|
|
@@ -164,6 +170,7 @@ public class WebGatewayImpl implements WebGateway {
|
|
|
saveInfo.setClientId(deviceAddParam.getClientId());
|
|
|
saveInfo.setDevType(deviceAddParam.getDevType());
|
|
|
saveInfo.setSoftware(deviceAddParam.getSoftware());
|
|
|
+ saveInfo.setTenantId(deviceAddParam.getTenantId());
|
|
|
saveInfo.setStatusLight(1);
|
|
|
saveInfo.setOnline(0);
|
|
|
saveInfo.setIsDeleted(BasePO.DeleteFlag.NOT_DELETED);
|
|
@@ -213,7 +220,7 @@ public class WebGatewayImpl implements WebGateway {
|
|
|
SaTokenInfo tokenInfo = StpUtil.getTokenInfo();
|
|
|
AdminLoginRes res = CopyUtils.copy(tokenInfo, AdminLoginRes.class);
|
|
|
BeanUtils.copyProperties(adminUser, res);
|
|
|
-
|
|
|
+ res.setTenantId(adminUser.getTenantId());
|
|
|
log.info("当前用户account:{},登录成功", param.getAccount());
|
|
|
return res;
|
|
|
}
|