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

修改部分一键部署功能

parent b8f3031f
......@@ -60,16 +60,19 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
Set<Long> notIdSet = params.getBusinessIdNotList().stream().collect(Collectors.toSet());
//排除掉了父级,但是子集存在,需要吧父id排除到notlist外
SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery();
siteBusinessQuery.setBusinessIdNotList(params.getBusinessIdNotList());
List<SiteBusinessEntity> rootSiteBusiness = this.find(siteBusinessQuery).stream().filter(f -> f.getIsBusiness() == IsBusinessEnum.一级业务.getValue()).collect(Collectors.toList());
// siteBusinessQuery.setBusinessIdNotList(params.getBusinessIdNotList());
siteBusinessQuery.setIsBusiness(IsBusinessEnum.一级业务.getValue());
List<SiteBusinessEntity> rootSiteBusiness = this.find(siteBusinessQuery).stream().collect(Collectors.toList());
for (SiteBusinessEntity root : rootSiteBusiness) {
SiteBusinessQuery query = new SiteBusinessQuery();
query.setParentId(root.getId());
List<SiteBusinessEntity> childSiteBusiness = this.find(query, context);
//查询所有二级业务。如果二级业务不全部存在,则把一级业务排除掉
//判断排除的id是否包含所有
Boolean bool = false;
for (SiteBusinessEntity child : childSiteBusiness) {
if (!notIdSet.contains(child.getId())) {
if (!notIdSet.contains(child.getBusinessId())) {
bool = true;
break;
}
......@@ -90,7 +93,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
protected void findAfter(SiteBusinessEntity params, PageInfo pageInfo, Context context, List<SiteBusinessEntity> list) throws AppException {
if (!ObjectUtils.isEmpty(params.getBusinessIdNotList())) {
//排除掉已经存在的ids
log.info("idNotList:{}", JSON.toJSONString(params.getIdNotList()));
log.info("idNotList:{}", JSON.toJSONString(params.getBusinessIdNotList()));
Iterator<SiteBusinessEntity> iterator = list.iterator();
while (iterator.hasNext()) {
SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery();
......
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