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

添加业务修改通知php

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