This commit is contained in:
2025-12-25 20:18:43 +08:00
parent 19af647b04
commit 6bddf05c36
3 changed files with 24 additions and 16 deletions

View File

@@ -102,7 +102,7 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
if (shopInfo.getExpireTime() != null && (DateUtil.date().toLocalDateTime().isAfter(shopInfo.getExpireTime()))) {
throw new CzgException("店铺已过期,请联系商家");
}
if (SystemConstants.OneZero.ZERO == shopInfo.getOnSale() || shopInfo.getStatus() !=SystemConstants.OneZero.ONE) {
if (SystemConstants.OneZero.ZERO == shopInfo.getOnSale() || shopInfo.getStatus() != SystemConstants.OneZero.ONE) {
throw new CzgException("店铺已停业,请联系商家");
}
@@ -460,8 +460,8 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
@Override
public BigDecimal updateAmount(Long id, BigDecimal amount) {
ShopInfo shopInfo = getShopInfo(id);
if (shopInfo.getAmount() == null) {
shopInfo.setAmount(BigDecimal.ZERO);
if (shopInfo.getAmount() == null || shopInfo.getAmount().compareTo(BigDecimal.ZERO) <= 0) {
throw new CzgException("更新失败");
}
boolean flag = mapper.updateAmount(id, amount);
if (!flag) {