Commit a0e34f73 by huluobin

decimal divide

parent 6284ec5a
......@@ -141,7 +141,7 @@ public class AgentUserServiceImpl extends ServiceImpl<AgentUserMapper, AgentUser
switch (type) {
case 1:
case 2:
agentUser.setBalance(agentUser.getBalance().subtract(amount));
agentUser.setBalance(agentUser.getBalance().add(amount));
if (agentUser.getBalance().compareTo(BigDecimal.ZERO) < 0) {
throw new RRException("余额不足");
}
......
......@@ -114,7 +114,7 @@ public class MallOrderPayServiceImpl implements MallOrderPayService {
if (agentUser == null) {
throw new RRException(ErrorCode.ER_2007);
}
agentUserService.addBalanceLog(2, mallOrder.getTotalPayAmount(), agentUser.getId());
agentUserService.addBalanceLog(2, BigDecimal.ZERO.subtract(mallOrder.getTotalPayAmount()), agentUser.getId());
mallOrder.setStatus(MallOrder.STATUS_UN_SHIP);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment