支付方式接口修改

This commit is contained in:
张松 2025-03-04 16:19:30 +08:00
parent 04f9457916
commit 51743ff067
1 changed files with 4 additions and 2 deletions

View File

@ -45,8 +45,10 @@ public class ShopPayTypeServiceImpl extends ServiceImpl<ShopPayTypeMapper, ShopP
@Override
public Boolean add(Long shopId, ShopPayType shopPayType) {
long count = count(new QueryWrapper().eq(ShopPayType::getPayType, shopPayType.getPayType()).or(r -> {
r.eq(ShopPayType::getPayName, shopPayType.getPayName());
long count = count(new QueryWrapper().eq(ShopPayType::getShopId, shopId).and(r -> {
r.eq(ShopPayType::getPayType, shopPayType.getPayType()).or(r1 -> {
r1.eq(ShopPayType::getPayName, shopPayType.getPayName());
});
}));
if (count > 0) {
throw new ApiNotPrintException("支付方式或支付名称已存在");