| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | myToDoVO.setContractCount((int) contractCount); |
| | | List<String> contractIds = contractService.lambdaQuery().eq(TContract::getTenantId, loginUserApplet.getUserId()).list() |
| | | .stream().map(TContract::getId).collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(contractIds)){ |
| | | myToDoVO.setBillCount(0); |
| | | myToDoVO.setContractCount(0); |
| | | return R.ok(myToDoVO); |
| | | } |
| | | int billCount = billService.lambdaQuery().in(TBill::getContractId, contractIds).eq(TBill::getPayFeesStatus, 1).list().size(); |
| | | myToDoVO.setBillCount(billCount); |
| | | }else { |
| | |
| | | List<TContract> contractList = contractService.lambdaQuery().eq(TContract::getTenantId, loginUserApplet.getUserId()) |
| | | .eq(TContract::getStatus, 4).list(); |
| | | List<THouse> houseList = houseService.list(); |
| | | List<TBill> bills = billService.lambdaQuery().eq(TBill::getPayFeesStatus,3).orderByDesc(TBill::getPayFeesTime).list(); |
| | | List<TBill> bills = billService.lambdaQuery().orderByDesc(TBill::getPayableFeesTime).list(); |
| | | for (TContract contract : contractList) { |
| | | THouse tHouse = houseList.stream().filter(e -> e.getId().equals(contract.getHouseId())).findFirst().orElse(null); |
| | | TBill bill = bills.stream().filter(e -> e.getContractId().equals(contract.getId())).findFirst().orElse(null); |