|
@@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.base.BaseEntity;
|
|
|
-import com.fjhx.constants.IotManagementLockConstant;
|
|
|
import com.fjhx.constants.ErrorMsgConstant;
|
|
|
+import com.fjhx.constants.IotManagementLockConstant;
|
|
|
import com.fjhx.constants.StatusConstant;
|
|
|
import com.fjhx.entity.FileInfo;
|
|
|
import com.fjhx.entity.bom.Bom;
|
|
@@ -82,7 +82,7 @@ public class BomServiceImpl extends ServiceImpl<BomMapper, Bom> implements BomSe
|
|
|
Assert.notEmpty(productId, "产品id不能为空");
|
|
|
Assert.notEmpty(bomVo.getEdition(), "版本号不能为空");
|
|
|
|
|
|
- // 保证每个租户物料编码唯一
|
|
|
+ // 保证一个产品只有一个bom是启用状态
|
|
|
Boolean flag = redisLockClient.lockFair(IotManagementLockConstant.BOM_EDITION_LOCK + productId,
|
|
|
() -> {
|
|
|
Long count = count(Bom::getProductId, productId);
|
|
@@ -108,7 +108,7 @@ public class BomServiceImpl extends ServiceImpl<BomMapper, Bom> implements BomSe
|
|
|
Assert.notEmpty(currentEdition, "是否启用版本不能为空");
|
|
|
|
|
|
if (StatusConstant.YES.equals(currentEdition)) {
|
|
|
- // 保证每个租户物料编码唯一
|
|
|
+ // 保证一个产品只有一个bom是启用状态
|
|
|
Boolean flag = redisLockClient.lockFair(IotManagementLockConstant.BOM_EDITION_LOCK + productId,
|
|
|
() -> {
|
|
|
update(Wrappers.<Bom>lambdaUpdate().set(Bom::getCurrentEdition, StatusConstant.NO).eq(Bom::getProductId, productId));
|