Skip to content

Commit

Permalink
fix(产品管理): 产品启用时会重复触发DeviceProductDeployEvent事件 (#513)
Browse files Browse the repository at this point in the history
Co-authored-by: XIXUANHAO <[email protected]>
  • Loading branch information
XIXUANHAO and XIXUANHAO authored Oct 8, 2024
1 parent 6dc16ce commit 9b9545e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.extern.slf4j.Slf4j;
import org.hswebframework.ezorm.rdb.mapping.ReactiveRepository;
import org.hswebframework.web.bean.FastBeanCopier;
import org.hswebframework.web.crud.events.EntityEventHelper;
import org.hswebframework.web.crud.service.GenericReactiveCrudService;
import org.hswebframework.web.exception.BusinessException;
import org.jetlinks.community.device.entity.DeviceInstanceEntity;
Expand Down Expand Up @@ -43,6 +44,7 @@ public Mono<Integer> deploy(String id) {
.set(DeviceProductEntity::getState, DeviceProductState.registered.getValue())
.where(DeviceProductEntity::getId, id)
.execute()
.as(EntityEventHelper::setDoNotFireEvent)
)
.flatMap(i -> FastBeanCopier
.copy(product, new DeviceProductDeployEvent())
Expand Down

0 comments on commit 9b9545e

Please sign in to comment.