商户余额更新
This commit is contained in:
@@ -459,7 +459,7 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
|||||||
@Override
|
@Override
|
||||||
public BigDecimal updateAmount(Long id, BigDecimal amount) {
|
public BigDecimal updateAmount(Long id, BigDecimal amount) {
|
||||||
ShopInfo shopInfo = getShopInfo(id);
|
ShopInfo shopInfo = getShopInfo(id);
|
||||||
if (shopInfo.getAmount() == null || shopInfo.getAmount().compareTo(BigDecimal.ZERO) <= 0) {
|
if (shopInfo.getAmount().add(amount).compareTo(BigDecimal.ZERO) < 0) {
|
||||||
throw new CzgException("更新失败");
|
throw new CzgException("更新失败");
|
||||||
}
|
}
|
||||||
boolean flag = mapper.updateAmount(id, amount);
|
boolean flag = mapper.updateAmount(id, amount);
|
||||||
|
|||||||
Reference in New Issue
Block a user