物料
This commit is contained in:
@@ -215,5 +215,7 @@ public class BasProduct extends BaseEntity
|
|||||||
|
|
||||||
private Integer quantity;
|
private Integer quantity;
|
||||||
|
|
||||||
|
private String updateId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ package com.ruoyi.bas.BasProduct.service.impl;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.bas.BasProduct.mapper.BasProductMapper;
|
import com.ruoyi.bas.BasProduct.mapper.BasProductMapper;
|
||||||
@@ -91,10 +93,15 @@ public class BasProductServiceImpl implements IBasProductService
|
|||||||
@Override
|
@Override
|
||||||
public int updateBasProduct(BasProduct basProduct)
|
public int updateBasProduct(BasProduct basProduct)
|
||||||
{
|
{
|
||||||
BasProduct basProduct1 = basProductMapper.selectBasProductByProductId(basProduct.getProductId());
|
BasProduct basProduct1 = new BasProduct();
|
||||||
if(basProduct1!=null){
|
basProduct1.setProductId(basProduct.getProductId());
|
||||||
return 0;
|
basProduct1.setUpdateId(basProduct.getProductGuid());
|
||||||
|
List<BasProduct> basProducts = basProductMapper.selectBasProductList(basProduct1);
|
||||||
|
if (CollUtil.isNotEmpty(basProducts)){
|
||||||
|
throw new RuntimeException("物料编号已存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return basProductMapper.updateBasProduct(basProduct);
|
return basProductMapper.updateBasProduct(basProduct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="selectBasProductList" parameterType="BasProduct" resultMap="BasProductResult">
|
<select id="selectBasProductList" parameterType="BasProduct" resultMap="BasProductResult">
|
||||||
<include refid="selectBasProductVo"/>
|
<include refid="selectBasProductVo"/>
|
||||||
<where>
|
<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="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="price != null and price != ''"> and price like concat('%', #{price}, '%')</if>
|
||||||
<if test="cargoNo != null and cargoNo != ''"> and cargo_no like concat('%', #{cargoNo}, '%')</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="spare37 != null and spare37 != ''"> and spare37 like concat('%', #{spare37}, '%')</if>
|
||||||
<if test="spare38 != null and spare38 != ''"> and spare38 like concat('%', #{spare38}, '%')</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="spare39 != null and spare39 != ''"> and spare39 like concat('%', #{spare39}, '%')</if>
|
||||||
|
<if test="updateId != null and updateId != ''"> and product_guid != #{updateId}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user