|
@@ -1,4 +1,4 @@
|
|
-package com.fjhx.serve.product.service.impl;
|
|
|
|
|
|
+package com.fjhx.product.service.impl;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -6,13 +6,13 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.fjhx.base.BaseEntity;
|
|
import com.fjhx.base.BaseEntity;
|
|
-import com.fjhx.serve.classify.service.ClassifyService;
|
|
|
|
-import com.fjhx.constant.LockConstant;
|
|
|
|
|
|
+import com.fjhx.classify.service.ClassifyService;
|
|
|
|
+import com.fjhx.product.mapper.ProductMapper;
|
|
|
|
+import com.fjhx.product.service.ProductService;
|
|
|
|
+import com.fjhx.constant.ProductLibraryLockConstant;
|
|
import com.fjhx.constants.ErrorMsgConstant;
|
|
import com.fjhx.constants.ErrorMsgConstant;
|
|
import com.fjhx.entity.product.Product;
|
|
import com.fjhx.entity.product.Product;
|
|
import com.fjhx.params.product.ProductVo;
|
|
import com.fjhx.params.product.ProductVo;
|
|
-import com.fjhx.serve.product.mapper.ProductMapper;
|
|
|
|
-import com.fjhx.serve.product.service.ProductService;
|
|
|
|
import com.fjhx.utils.Assert;
|
|
import com.fjhx.utils.Assert;
|
|
import com.fjhx.utils.WrapperUtil;
|
|
import com.fjhx.utils.WrapperUtil;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
@@ -64,7 +64,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
|
Assert.notEmpty(productVo.getCode(), "产品编码不能为空");
|
|
Assert.notEmpty(productVo.getCode(), "产品编码不能为空");
|
|
|
|
|
|
String tenantId = AuthUtil.getTenantId();
|
|
String tenantId = AuthUtil.getTenantId();
|
|
- Boolean flag = redisLockClient.lockFair(LockConstant.PRODUCT_CODE_ONLY_LOCK + tenantId, () -> {
|
|
|
|
|
|
+ Boolean flag = redisLockClient.lockFair(ProductLibraryLockConstant.PRODUCT_CODE_ONLY_LOCK + tenantId, () -> {
|
|
productCodeOnly(tenantId, productVo.getCode(), null);
|
|
productCodeOnly(tenantId, productVo.getCode(), null);
|
|
save(productVo);
|
|
save(productVo);
|
|
return true;
|
|
return true;
|
|
@@ -76,7 +76,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
|
public void edit(ProductVo productVo) {
|
|
public void edit(ProductVo productVo) {
|
|
Assert.notEmpty(productVo.getId(), "产品id不能为空");
|
|
Assert.notEmpty(productVo.getId(), "产品id不能为空");
|
|
String tenantId = AuthUtil.getTenantId();
|
|
String tenantId = AuthUtil.getTenantId();
|
|
- Boolean flag = redisLockClient.lockFair(LockConstant.PRODUCT_CODE_ONLY_LOCK + tenantId, () -> {
|
|
|
|
|
|
+ Boolean flag = redisLockClient.lockFair(ProductLibraryLockConstant.PRODUCT_CODE_ONLY_LOCK + tenantId, () -> {
|
|
productCodeOnly(tenantId, productVo.getCode(), productVo.getId());
|
|
productCodeOnly(tenantId, productVo.getCode(), productVo.getId());
|
|
updateById(productVo);
|
|
updateById(productVo);
|
|
return true;
|
|
return true;
|