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

添加业务修改通知php

parent e8ea09f0
...@@ -199,7 +199,6 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -199,7 +199,6 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
throw new AppException("请选择对应站点"); throw new AppException("请选择对应站点");
} }
List<Long> businessIdList = Arrays.asList(businessIds.split(",")).stream().map(Long::parseLong).collect(Collectors.toList()); List<Long> businessIdList = Arrays.asList(businessIds.split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
//先删除后再新增 //先删除后再新增
SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery(); SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery();
siteBusinessQuery.setSiteId(siteId); siteBusinessQuery.setSiteId(siteId);
...@@ -209,6 +208,8 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -209,6 +208,8 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
if (!ObjectUtils.isEmpty(ids)) { if (!ObjectUtils.isEmpty(ids)) {
siteBusinessService.remove(ids, context); siteBusinessService.remove(ids, context);
} }
BusinessQuery businessQuery = new BusinessQuery(); BusinessQuery businessQuery = new BusinessQuery();
businessQuery.setIdList(businessIdList); businessQuery.setIdList(businessIdList);
this.find(businessQuery).stream() this.find(businessQuery).stream()
...@@ -226,7 +227,10 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -226,7 +227,10 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
private void updateOrSave(BusinessEntity item, Long siteId, Context context) { private void updateOrSave(BusinessEntity item, Long siteId, Context context) {
SiteBusinessEntity siteBusinessEntity = new SiteBusinessEntity(); SiteBusinessEntity siteBusinessEntity = new SiteBusinessEntity();
BeanUtils.copyProperties(item, siteBusinessEntity, BeanUtil.getNullPropertyNames(item));
// BeanUtils.copyProperties(item, siteBusinessEntity, BeanUtil.getNullPropertyNames(item));
SiteEntity siteEntity = siteService.get(siteId); SiteEntity siteEntity = siteService.get(siteId);
if (ObjectUtils.isEmpty(siteEntity)) { if (ObjectUtils.isEmpty(siteEntity)) {
throw new AppException("未找到相应站点!"); throw new AppException("未找到相应站点!");
...@@ -235,7 +239,17 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -235,7 +239,17 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
siteBusinessEntity.setSiteName(siteEntity.getSiteName()); siteBusinessEntity.setSiteName(siteEntity.getSiteName());
siteBusinessEntity.setBusinessId(item.getId()); siteBusinessEntity.setBusinessId(item.getId());
siteBusinessEntity.setBusinessName(item.getName()); siteBusinessEntity.setBusinessName(item.getName());
siteBusinessEntity.setId(null); siteBusinessEntity.setAncestors(item.getAncestors());
siteBusinessEntity.setIsBusiness(item.getIsBusiness());
siteBusinessEntity.setParentId(0L);
siteBusinessEntity.setStatus(item.getStatus());
siteBusinessEntity.setRemark(item.getRemark());
siteBusinessEntity.setCanorder(item.getCanorder());
siteBusinessEntity.setCantake(item.getCantake());
siteBusinessEntity.setDatashow(item.getDatashow());
siteBusinessEntity.setEnglishname(item.getEnglishname());
siteBusinessEntity.setFlownum(item.getFlownum());
siteBusinessEntity.setBusinessType(item.getBusinessType());
siteBusinessEntity.setCreateUserId(context == null ? 1L : context.getUser() == null ? 1L : context.getUser().getId()); siteBusinessEntity.setCreateUserId(context == null ? 1L : context.getUser() == null ? 1L : context.getUser().getId());
siteBusinessEntity.setCreateTime(new Date()); siteBusinessEntity.setCreateTime(new Date());
......
...@@ -184,7 +184,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu ...@@ -184,7 +184,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
List<SiteBusinessEntity> collect = Arrays.asList(ids).stream() List<SiteBusinessEntity> collect = 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.getBusinessId())).stream(); return this.find(new SiteBusinessQuery().parentId(siteBusinessEntity.getId())).stream();
}).collect(Collectors.toList()); }).collect(Collectors.toList());
Long[] childIds = collect.stream().map(item->item.getId()).toArray(Long[]::new); Long[] childIds = collect.stream().map(item->item.getId()).toArray(Long[]::new);
......
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