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);
}

View File

@@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBasProductList" parameterType="BasProduct" resultMap="BasProductResult">
<include refid="selectBasProductVo"/>
<where>
<if test="productId != null and productId != ''"> and product_id like concat('%', #{productId}, '%')</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="parentId != null and parentId != ''"> and parent_id like concat('%', #{parentId}, '%')</if>
<if test="price != null and price != ''"> and price like concat('%', #{price}, '%')</if>
<if test="cargoNo != null and cargoNo != ''"> and cargo_no like concat('%', #{cargoNo}, '%')</if>
@@ -108,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="spare37 != null and spare37 != ''"> and spare37 like concat('%', #{spare37}, '%')</if>
<if test="spare38 != null and spare38 != ''"> and spare38 like concat('%', #{spare38}, '%')</if>
<if test="spare39 != null and spare39 != ''"> and spare39 like concat('%', #{spare39}, '%')</if>
<if test="updateId != null and updateId != ''"> and product_guid != #{updateId}</if>
</where>
</select>