Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -45,8 +45,10 @@ public class ShopPayTypeServiceImpl extends ServiceImpl<ShopPayTypeMapper, ShopP
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean add(Long shopId, ShopPayType shopPayType) {
|
public Boolean add(Long shopId, ShopPayType shopPayType) {
|
||||||
long count = count(new QueryWrapper().eq(ShopPayType::getPayType, shopPayType.getPayType()).or(r -> {
|
long count = count(new QueryWrapper().eq(ShopPayType::getShopId, shopId).and(r -> {
|
||||||
r.eq(ShopPayType::getPayName, shopPayType.getPayName());
|
r.eq(ShopPayType::getPayType, shopPayType.getPayType()).or(r1 -> {
|
||||||
|
r1.eq(ShopPayType::getPayName, shopPayType.getPayName());
|
||||||
|
});
|
||||||
}));
|
}));
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
throw new ApiNotPrintException("支付方式或支付名称已存在");
|
throw new ApiNotPrintException("支付方式或支付名称已存在");
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class ShopStorageGoodServiceImpl extends ServiceImpl<ShopStorageGoodMappe
|
|||||||
public Boolean saveInfo(Long shopId, ShopStorageGoodDTO shopStorageGoodDTO) {
|
public Boolean saveInfo(Long shopId, ShopStorageGoodDTO shopStorageGoodDTO) {
|
||||||
ShopStorageGood shopStorageGood = BeanUtil.copyProperties(shopStorageGoodDTO, ShopStorageGood.class);
|
ShopStorageGood shopStorageGood = BeanUtil.copyProperties(shopStorageGoodDTO, ShopStorageGood.class);
|
||||||
if (shopStorageGoodDTO.getSource() == 1) {
|
if (shopStorageGoodDTO.getSource() == 1) {
|
||||||
Product product = productService.getOne(new QueryWrapper().eq(Product::getShopId, shopId).eq(Product::getId, shopStorageGoodDTO.getId()));
|
Product product = productService.getOne(new QueryWrapper().eq(Product::getShopId, shopId).eq(Product::getId, shopStorageGoodDTO.getProdId()));
|
||||||
if (product == null) {
|
if (product == null) {
|
||||||
throw new ApiNotPrintException("商品不存在");
|
throw new ApiNotPrintException("商品不存在");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user