|
@@ -76,14 +76,26 @@ public class AccountApiController extends AbstractApiController {
|
|
bo.setBalance(wallet.getBalance().add(earnings.getBalance()));
|
|
bo.setBalance(wallet.getBalance().add(earnings.getBalance()));
|
|
bo.setSettledAmount(earnings.getTotalInamount());
|
|
bo.setSettledAmount(earnings.getTotalInamount());
|
|
BigDecimal pendingAmount = redEnvelopeService.sumWithDay(null,userId,1);
|
|
BigDecimal pendingAmount = redEnvelopeService.sumWithDay(null,userId,1);
|
|
|
|
+ if (pendingAmount == null){
|
|
|
|
+ pendingAmount = BigDecimal.ZERO;
|
|
|
|
+ }
|
|
bo.setPendingAmount(pendingAmount);
|
|
bo.setPendingAmount(pendingAmount);
|
|
|
|
|
|
BigDecimal tDEamings = redEnvelopeService.sumWithDay(1,userId,3);
|
|
BigDecimal tDEamings = redEnvelopeService.sumWithDay(1,userId,3);
|
|
|
|
+ if (tDEamings == null){
|
|
|
|
+ tDEamings = BigDecimal.ZERO;
|
|
|
|
+ }
|
|
bo.setTDEamings(tDEamings);
|
|
bo.setTDEamings(tDEamings);
|
|
BigDecimal yDEamings = redEnvelopeService.sumWithDay(2,userId,3);
|
|
BigDecimal yDEamings = redEnvelopeService.sumWithDay(2,userId,3);
|
|
|
|
+ if (yDEamings == null){
|
|
|
|
+ yDEamings = BigDecimal.ZERO;
|
|
|
|
+ }
|
|
bo.setTDEamings(yDEamings.subtract(tDEamings));
|
|
bo.setTDEamings(yDEamings.subtract(tDEamings));
|
|
Integer day = DateUtil.thisDayOfMonth();
|
|
Integer day = DateUtil.thisDayOfMonth();
|
|
BigDecimal mTDEamings = redEnvelopeService.sumWithDay(day,userId,3);
|
|
BigDecimal mTDEamings = redEnvelopeService.sumWithDay(day,userId,3);
|
|
|
|
+ if (mTDEamings == null){
|
|
|
|
+ mTDEamings = BigDecimal.ZERO;
|
|
|
|
+ }
|
|
bo.setTDEamings(mTDEamings);
|
|
bo.setTDEamings(mTDEamings);
|
|
|
|
|
|
return ResultGenerator.genSuccessResult(bo);
|
|
return ResultGenerator.genSuccessResult(bo);
|