|
@@ -100,7 +100,7 @@ public class BaseBuildServiceImpl extends AbstractCrudService<BaseBuildMapper, B
|
|
|
if(CollectionUtils.isNotEmpty(list)){
|
|
|
for(int i=0;i<list.size();i++){
|
|
|
LambdaQueryWrapper<BaseBuildFacilityRelate> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
- queryWrapper1.eq(BaseBuildFacilityRelate::getBuildId,list.get(i).getBuildNum());
|
|
|
+ queryWrapper1.eq(BaseBuildFacilityRelate::getBuildId,list.get(i).getId());
|
|
|
Integer count = baseBuildFacilityRelateService.count(queryWrapper1);
|
|
|
list.get(i).setBuildFacilityCount(count);
|
|
|
}
|
|
@@ -122,13 +122,16 @@ public class BaseBuildServiceImpl extends AbstractCrudService<BaseBuildMapper, B
|
|
|
for(int i=0;i<page.getRecords().size();i++){
|
|
|
BuildFacilityRelateResponeVO responeVO = new BuildFacilityRelateResponeVO();
|
|
|
responeVO.setBuildId(requestVO.getBuildId());
|
|
|
+ responeVO.setFacilityId(page.getRecords().get(i).getId());
|
|
|
responeVO.setFacilityNum(page.getRecords().get(i).getFacilityNum());
|
|
|
responeVO.setFacilityName(page.getRecords().get(i).getFacilityName());
|
|
|
|
|
|
LambdaQueryWrapper<BaseFacilityType> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
queryWrapper1.eq(BaseFacilityType::getTypeCode,page.getRecords().get(i).getFacilityType());
|
|
|
BaseFacilityType one = baseFacilityTypeService.getOne(queryWrapper1);
|
|
|
- responeVO.setFacilityType(one.getTypeName());
|
|
|
+ if(one != null){
|
|
|
+ responeVO.setFacilityType(one.getTypeName());
|
|
|
+ }
|
|
|
|
|
|
responeVO.setAddress(page.getRecords().get(i).getAddress());
|
|
|
|
|
@@ -146,27 +149,29 @@ public class BaseBuildServiceImpl extends AbstractCrudService<BaseBuildMapper, B
|
|
|
@Override
|
|
|
public void setBuildFacilityStatus(BuildFacilityStatusVO statusVO){
|
|
|
BaseBuild baseBuild = new BaseBuild();
|
|
|
+ LambdaQueryWrapper<BaseBuild> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(BaseBuild::getDeleteFlag,0)
|
|
|
+ .eq(BaseBuild::getId,statusVO.getBuildId())
|
|
|
+ .eq(BaseBuild::getTenantId,SecurityUtils.getTenantId());
|
|
|
+ BaseBuild one = this.getOne(queryWrapper);
|
|
|
|
|
|
if(statusVO.getStatus() == 1){
|
|
|
- LambdaQueryWrapper<BaseBuild> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.eq(BaseBuild::getDeleteFlag,0)
|
|
|
- .eq(BaseBuild::getId,statusVO.getBuildId())
|
|
|
- .eq(BaseBuild::getTenantId,SecurityUtils.getTenantId());
|
|
|
- BaseBuild one = this.getOne(queryWrapper);
|
|
|
|
|
|
- if(one.getFacilityId() != null && (""+one.getFacilityId()).length() > 0){
|
|
|
+ if(one.getFacilityId() != null && (""+one.getFacilityId()).length() > 1){
|
|
|
throw new BusinessException("绑定失败,该建筑已绑定设施");
|
|
|
}
|
|
|
- LambdaQueryWrapper<BaseGgpFacility> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
- queryWrapper1.like(BaseGgpFacility::getFacilityNum,statusVO.getFacilityNum())
|
|
|
- .eq(BaseGgpFacility::getTenantId,SecurityUtils.getTenantId());
|
|
|
- BaseGgpFacility one1 = baseGgpFacilityService.getOne(queryWrapper1);
|
|
|
|
|
|
baseBuild.setId(statusVO.getBuildId());
|
|
|
- baseBuild.setFacilityId(one1.getId());
|
|
|
+ baseBuild.setFacilityId(statusVO.getFacilityId());
|
|
|
}else{
|
|
|
+ if(one == null){
|
|
|
+ throw new BusinessException("该建筑信息不存在");
|
|
|
+ }
|
|
|
+
|
|
|
baseBuild.setId(statusVO.getBuildId());
|
|
|
- baseBuild.setFacilityId(null);
|
|
|
+ baseBuild.setFacilityId(0);
|
|
|
+ baseBuild.setUpdateBy(SecurityUtils.getUsername());
|
|
|
+ baseBuild.setUpdateTime(LocalDateTime.now());
|
|
|
}
|
|
|
this.updateById(baseBuild);
|
|
|
|