This commit is contained in:
张怡蓉
2025-10-17 16:04:45 +08:00
parent 1f9fe24ee6
commit e4de36d3f4
3 changed files with 14 additions and 4 deletions

View File

@@ -215,5 +215,7 @@ public class BasProduct extends BaseEntity
private Integer quantity;
private String updateId;
}

View File

@@ -3,8 +3,10 @@ package com.ruoyi.bas.BasProduct.service.impl;
import java.util.Date;
import java.util.List;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import com.ruoyi.common.utils.SecurityUtils;
import org.apache.commons.math3.stat.descriptive.summary.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bas.BasProduct.mapper.BasProductMapper;
@@ -91,10 +93,15 @@ public class BasProductServiceImpl implements IBasProductService
@Override
public int updateBasProduct(BasProduct basProduct)
{
BasProduct basProduct1 = basProductMapper.selectBasProductByProductId(basProduct.getProductId());
if(basProduct1!=null){
return 0;
BasProduct basProduct1 = new BasProduct();
basProduct1.setProductId(basProduct.getProductId());
basProduct1.setUpdateId(basProduct.getProductGuid());
List<BasProduct> basProducts = basProductMapper.selectBasProductList(basProduct1);
if (CollUtil.isNotEmpty(basProducts)){
throw new RuntimeException("物料编号已存在");
}
return basProductMapper.updateBasProduct(basProduct);
}