|
|
@@ -373,6 +373,7 @@ public class ProjectService {
|
|
|
deviceRelation.setId(new IdWorker(NumberConstant.ONE).nextId());
|
|
|
deviceRelation.setDeviceId(Long.parseLong(deviceId));
|
|
|
deviceRelation.setMountainId(headerData.getMountainId());
|
|
|
+ deviceRelation.setCompanyId(headerData.getCompanyId());
|
|
|
deviceRelation.setRelateDeviceId(id);
|
|
|
deviceRelation.setStatus(NumberConstant.ZERO);
|
|
|
deviceRelation.setCreateBy(headerData.getCreateBy() == null ? null : Long.parseLong(headerData.getCreateBy()));
|
|
|
@@ -445,8 +446,9 @@ public class ProjectService {
|
|
|
}
|
|
|
|
|
|
public PageRes deviceBindSelect(DeviceQuery deviceQuery, HttpServletRequest request) {
|
|
|
+ HeaderData headerData = commonService.getHeaderData(request);
|
|
|
PageHelper.startPage(deviceQuery.getPage(), deviceQuery.getPageSize());
|
|
|
- List<ProjectDeviceVO> list = projectMapper.selectNotBindDeviceList(deviceQuery);
|
|
|
+ List<ProjectDeviceVO> list = projectMapper.selectNotBindDeviceList(deviceQuery, headerData);
|
|
|
PageInfo<ProjectDeviceVO> info = new PageInfo<>(list);
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
return PageRes.build(info, list);
|
|
|
@@ -1371,12 +1373,18 @@ public class ProjectService {
|
|
|
vo.setProjectTotal(count);
|
|
|
int deviceCount = deviceMapper.selectCountByProject(projectId, companyId);
|
|
|
vo.setDeviceTotal(deviceCount);
|
|
|
- List<KwsProject> projectList = projectMapper.selectList(new LambdaQueryWrapper<KwsProject>()
|
|
|
- .eq(org.apache.commons.lang3.StringUtils.isNotBlank(projectId), KwsProject::getId, Long.parseLong(projectId))
|
|
|
- .eq(org.apache.commons.lang3.StringUtils.isNotBlank(companyId), KwsProject::getCompanyId, Long.parseLong(companyId))
|
|
|
+ LambdaQueryWrapper<KwsProject> projectLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ projectLambdaQueryWrapper.eq(KwsProject::getDelFlag, 0);
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isNotBlank(projectId)) {
|
|
|
+ projectLambdaQueryWrapper.eq(KwsProject::getId, Long.parseLong(projectId));
|
|
|
+ }
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isNotBlank(companyId)) {
|
|
|
+ projectLambdaQueryWrapper.eq(KwsProject::getCompanyId, Long.parseLong(companyId));
|
|
|
+ }
|
|
|
+ List<KwsProject> projectList = projectMapper.selectList(projectLambdaQueryWrapper
|
|
|
);
|
|
|
List<Long> projectIdList = new ArrayList<>();
|
|
|
- if (!CollectionUtils.isEmpty(projectList)) {
|
|
|
+ if (!CollectionUtils.isEmpty(projectList) && projectList.size() > 0) {
|
|
|
projectIdList = projectList.stream().map(KwsProject::getId).distinct().collect(Collectors.toList());
|
|
|
}
|
|
|
//统计全部面积
|