Commit 233afd7a59b6e62bde41d331a5d36d7fc24eab08
1 parent
3535fda9
feat:【IoT 物联网】商品新增时,productKey 不在跨租户校验,因为只需要保证 productKey + deviceName 跨租户唯一即可
Showing
1 changed file
with
3 additions
and
7 deletions
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/product/IotProductServiceImpl.java
| ... | ... | @@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollUtil; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 6 | 6 | import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; |
| 7 | -import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils; | |
| 8 | 7 | import cn.iocoder.yudao.module.iot.controller.admin.product.vo.product.IotProductPageReqVO; |
| 9 | 8 | import cn.iocoder.yudao.module.iot.controller.admin.product.vo.product.IotProductSaveReqVO; |
| 10 | 9 | import cn.iocoder.yudao.module.iot.dal.dataobject.product.IotProductDO; |
| ... | ... | @@ -47,12 +46,9 @@ public class IotProductServiceImpl implements IotProductService { |
| 47 | 46 | @Override |
| 48 | 47 | public Long createProduct(IotProductSaveReqVO createReqVO) { |
| 49 | 48 | // 1. 校验 ProductKey |
| 50 | - TenantUtils.executeIgnore(() -> { | |
| 51 | - // 为什么忽略租户?避免多个租户之间,productKey 重复,导致 TDengine 设备属性表重复 | |
| 52 | - if (productMapper.selectByProductKey(createReqVO.getProductKey()) != null) { | |
| 53 | - throw exception(PRODUCT_KEY_EXISTS); | |
| 54 | - } | |
| 55 | - }); | |
| 49 | + if (productMapper.selectByProductKey(createReqVO.getProductKey()) != null) { | |
| 50 | + throw exception(PRODUCT_KEY_EXISTS); | |
| 51 | + } | |
| 56 | 52 | |
| 57 | 53 | // 2. 插入 |
| 58 | 54 | IotProductDO product = BeanUtils.toBean(createReqVO, IotProductDO.class) | ... | ... |