修改文件访问路径

This commit is contained in:
haozq 2025-09-16 14:17:41 +08:00
parent 2d512b38c3
commit 44d9882009
3 changed files with 19 additions and 1 deletions

View File

@ -114,4 +114,11 @@ public interface ProductMapper {
* @return
*/
Integer getProductByName(TbProduct product);
/**
*
* @param product
* @return
*/
Integer getProductOnCz(TbProduct product);
}

View File

@ -137,7 +137,6 @@ public class ProductServiceImpl implements ProductService {
}
}
}
}
}catch (Exception e){
log.error(e.toString(),e);
@ -266,6 +265,12 @@ public class ProductServiceImpl implements ProductService {
@Override
public AjaxResult deleteProduct(TbProduct product) {
try{
//查看差评是否被使用
Integer isCz=mapper.getProductOnCz(product);
if(isCz!=null && isCz>0){
return AjaxResult.error("改产品已和宣传物料绑定,不允许删除");
}
//删除图片
List<ProductCaseImage> list=mapper.getCaseImageByTable(product.getId(),"tb_product");
if(StringUtils.isNotEmpty(list)){

View File

@ -67,6 +67,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and id!=#{id}
</if>
</select>
<select id="getProductOnCz" resultType="java.lang.Integer">
select count(1)
from tb_promotion_material_product
where product_id=#{id}
</select>
<insert id="addProduct" parameterType="com.bonus.business.domain.TbProduct" keyProperty="id" useGeneratedKeys="true" >