支付方式接口
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user