|
|
@ -25,6 +25,14 @@ public class ProductInformationService extends MybatisBaseService<ProductInforma |
|
|
|
|
|
|
|
public ResultBean save(ProductInformationDto dto){ |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
Integer integer = baseMapper.selectInformationByNumber(dto.getNumber()); |
|
|
|
if (integer != 0){ |
|
|
|
return rb.setMsg("该品牌编码已占用"); |
|
|
|
} |
|
|
|
Integer integer1 = baseMapper.selectInformationByName(dto.getName()); |
|
|
|
if (integer1 != 0){ |
|
|
|
return rb.setMsg("该品牌名称已存在"); |
|
|
|
} |
|
|
|
ProductInformation information = new ProductInformation(); |
|
|
|
BeanUtil.copyProperties(dto,information,"id","sid"); |
|
|
|
baseMapper.insert(information); |
|
|
|