支付方式接口

This commit is contained in:
张松
2025-02-26 10:59:07 +08:00
parent 533a5a4e7e
commit 6488a55355
6 changed files with 97 additions and 7 deletions

View File

@@ -1,5 +1,7 @@
package com.czg.service.account.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.czg.exception.ApiNotPrintException;
import com.czg.sa.StpKit;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
@@ -40,4 +42,18 @@ public class ShopPayTypeServiceImpl extends ServiceImpl<ShopPayTypeMapper, ShopP
}
return list;
}
@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());
}));
if (count > 0) {
throw new ApiNotPrintException("支付方式或支付名称已存在");
}
ShopPayType payType = BeanUtil.copyProperties(shopPayType, ShopPayType.class);
payType.setShopId(shopId);
return save(payType);
}
}

View File

@@ -71,6 +71,7 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
if (isVip != null) {
queryWrapper.eq(ShopUser::getIsVip, isVip);
}
queryWrapper.orderBy(ShopUser::getId, false);
return mapper.xmlPaginate("selectPageByKeyAndIsVip", PageUtil.buildPage(), queryWrapper);
}