Commit afec1783 authored by 赵啸非's avatar 赵啸非

添加业务修改通知php

parent c7f4326f
...@@ -152,19 +152,8 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu ...@@ -152,19 +152,8 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
} }
} }
@Override
protected void saveBefore(SiteBusinessEntity entity, Context context) throws AppException {
}
@Override
protected void updateBefore(SiteBusinessEntity entity, Context context) throws AppException {
super.updateBefore(entity, context);
}
@Override @Override
protected void updateAfter(SiteBusinessEntity entity, Context context) throws AppException { protected void updateAfter(SiteBusinessEntity entity, Context context) throws AppException {
//更新事项业务表中字段 //更新事项业务表中字段
List<BusinessMatterEntity> businessMatterEntities = businessMatterService.find(new BusinessMatterQuery().siteBusinessId(entity.getId())) List<BusinessMatterEntity> businessMatterEntities = businessMatterService.find(new BusinessMatterQuery().siteBusinessId(entity.getId()))
.stream() .stream()
...@@ -174,28 +163,34 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu ...@@ -174,28 +163,34 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
if (!ObjectUtils.isEmpty(businessMatterEntities)) { if (!ObjectUtils.isEmpty(businessMatterEntities)) {
businessMatterService.update(businessMatterEntities, context); businessMatterService.update(businessMatterEntities, context);
} }
super.updateAfter(entity, context); super.updateAfter(entity, context);
} }
@Override @Override
protected void removeBefore(Long[] ids, Context context) throws AppException { protected void removeBefore(Long[] ids, Context context) throws AppException {
List<SiteBusinessEntity> collect = Arrays.asList(ids).stream() List<SiteBusinessEntity> childs = Arrays.asList(ids).stream()
.flatMap(item -> { .flatMap(item -> {
SiteBusinessEntity siteBusinessEntity = this.get(item); SiteBusinessEntity siteBusinessEntity = this.get(item);
return this.find(new SiteBusinessQuery().parentId(siteBusinessEntity.getId())).stream(); return this.find(new SiteBusinessQuery().parentId(siteBusinessEntity.getId())).stream();
}).collect(Collectors.toList()); }).collect(Collectors.toList());
log.info("delete childs list:{}",JSON.toJSONString(childs));
log.info("delete list:{}",JSON.toJSONString(collect)); Long[] childIds = childs.stream().map(item->item.getId()).toArray(Long[]::new);
Long[] childIds = collect.stream().map(item->item.getId()).toArray(Long[]::new);
this.getDao().delete(childIds); this.getDao().delete(childIds);
Long[] bussinessIds = collect.stream().map(item->item.getBusinessId()).toArray(Long[]::new); Long[] bussinessIds = childs.stream().map(item->item.getBusinessId()).toArray(Long[]::new);
log.info("bussinessIds:{}",JSON.toJSONString(bussinessIds)); log.info("childBussinessIds:{}",JSON.toJSONString(bussinessIds));
if(!ObjectUtils.isEmpty(bussinessIds)){ if(!ObjectUtils.isEmpty(bussinessIds)){
businessService.remove(bussinessIds,context); businessService.remove(bussinessIds,context);
} }
List<Long> mainIds = this.get(ids, context).stream().map(item -> item.getBusinessId()).collect(Collectors.toList());
if(!ObjectUtils.isEmpty(mainIds)){
//删除
businessService.remove(mainIds,context);
}
} }
......
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