| | |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | AccountDto accountDto = new AccountDto(); |
| | | accountDto.setObjId(ownerDto.getMemberId()); |
| | | accountDto.setPartId(communityId); |
| | | accountDto.setAcctType(AccountDto.ACCT_TYPE_CASH); |
| | | List<AccountDto> accountDtos =accountInnerServiceSMOImpl.queryAccounts(accountDto); |
| | | if(!ListUtil.isNull(accountDtos)){ |
| | | ownerDto.setAcctAmount(accountDtos.get(0).getAmount()); |
| | | if (ListUtil.isNull(accountDtos)) { |
| | | return ResultVo.createResponseEntity(1, 1, ownerDto); |
| | | } |
| | | BigDecimal accountDec = new BigDecimal("0"); |
| | | for (AccountDto tmpAccountDto : accountDtos) { |
| | | accountDec = accountDec.add(new BigDecimal(tmpAccountDto.getAmount())); |
| | | } |
| | | accountDec = accountDec.setScale(2, BigDecimal.ROUND_HALF_UP); |
| | | |
| | | ownerDto.setAcctAmount(accountDec.doubleValue() + ""); |
| | | |
| | | return ResultVo.createResponseEntity(1, 1, ownerDto); |
| | | |
| | | } |
| | | |
| | | /** |