Commit 24de99c3 authored by 赵啸非's avatar 赵啸非

添加站点业务中子业务列表

parent 505fdf9d
......@@ -3,6 +3,7 @@ package com.mortals.xhx.module.site.service.impl;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.xhx.common.code.IsBusinessEnum;
import com.mortals.xhx.module.business.model.BusinessEntity;
import com.mortals.xhx.module.business.model.BusinessQuery;
import com.mortals.xhx.module.business.service.BusinessService;
......@@ -36,8 +37,6 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
@Autowired
private BusinessService businessService;
@Override
protected void findAfter(SiteBusinessEntity params, PageInfo pageInfo, Context context, List<SiteBusinessEntity> list) throws AppException {
list.stream().peek(item -> {
......@@ -46,6 +45,12 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
BusinessEntity businessEntity = businessService.get(item.getBusinessId());
if(!ObjectUtils.isEmpty(businessEntity)){
BeanUtils.copyProperties(businessEntity,item,"id");
//判断业务是否含有子业务
if(businessEntity.getIsBusiness()== IsBusinessEnum.一级业务.getValue()){
//添加二级业务列表
List<BusinessEntity> businessEntities = businessService.find(new BusinessQuery().parentId(businessEntity.getId()));
businessEntity.setChildren(businessEntities);
}
}
}
item.setChildren(childs);
......
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