Commit daf489b7 by 邹磊浩

修改代码

parent cbf8a54b
......@@ -84,17 +84,17 @@ public class BusinessServiceImpl implements IBusinessService {
.collect(Collectors.toList()));
}
}
// 获取关联服务
List<ServicesVo> servicesVos = servicesMapper.selectVoList(Wrappers.<Services>lambdaQuery()
.eq(Services::getBid, businessVo.getId()));
for (ServicesVo servicesVo : servicesVos) {
CityVo cityVo = cityMapper.selectVoById(servicesVo.getCityId());
if (cityVo != null) {
servicesVo.setCityName(cityVo.getName());
}
}
businessVo.setServicesVoList(servicesVos);
//
// // 获取关联服务
// List<ServicesVo> servicesVos = servicesMapper.selectVoList(Wrappers.<Services>lambdaQuery()
// .eq(Services::getBid, businessVo.getId()));
// for (ServicesVo servicesVo : servicesVos) {
// CityVo cityVo = cityMapper.selectVoById(servicesVo.getCityId());
// if (cityVo != null) {
// servicesVo.setCityName(cityVo.getName());
// }
// }
// businessVo.setServicesVoList(servicesVos);
}
}
return TableDataInfo.build(result);
......
......@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.pz.system.domain.Notice;
import com.pz.system.domain.vo.CityVo;
import com.pz.system.mapper.CityMapper;
import com.pz.system.mapper.NoticeMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
......@@ -36,6 +38,8 @@ public class ServicesServiceImpl implements IServicesService {
private final NoticeMapper noticeMapper;
private final CityMapper cityMapper;
/**
* 查询服务
*/
......@@ -55,6 +59,17 @@ public class ServicesServiceImpl implements IServicesService {
noticeMapper.selectList(new LambdaQueryWrapper<Notice>().eq(Notice::getSite, 2))
.stream().findFirst().ifPresent(notices -> service.setNotice(notices.getInfo()));
});*/
Optional.ofNullable(result.getRecords()).ifPresent(
servicesVos -> {
for (ServicesVo servicesVo : servicesVos) {
CityVo cityVo = cityMapper.selectVoById(servicesVo.getCityId());
if (cityVo != null) {
servicesVo.setCityName(cityVo.getName());
}
}
}
);
return TableDataInfo.build(result);
}
......@@ -110,7 +125,7 @@ public class ServicesServiceImpl implements IServicesService {
/**
* 保存前的数据校验
*/
private void validEntityBeforeSave(Services entity){
private void validEntityBeforeSave(Services entity) {
//TODO 做一些数据校验,如唯一约束
}
......@@ -119,7 +134,7 @@ public class ServicesServiceImpl implements IServicesService {
*/
@Override
public Boolean deleteWithValidByIds(Collection<Integer> ids, Boolean isValid) {
if(isValid){
if (isValid) {
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteBatchIds(ids) > 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment