Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<MovementDTO> getAgruped(Long startDate, Long endDate) {
- List<MovementDTO> movementDTOs = new ArrayList<>();
- // Block
- List<Movement> unBlockedCash = this.movementRepository.getUnBlockedCash(new DateTime().withMillis(startDate),
- new DateTime().withMillis(endDate));
- for (Movement movement : unBlockedCash) {
- movementDTOs.add(new MovementDTO(movement));
- }
- // Caixa
- movementDTOs.addAll(this.getByMovementGrouping());
- // Saque
- List<Movement> saques = this.movementRepository.getSaque(new DateTime().withMillis(startDate),
- new DateTime().withMillis(endDate));
- for (Movement movement : saques) {
- movementDTOs.add(new MovementDTO(movement));
- }
- return movementDTOs;
- }
- public List<MovementDTO> getByMovementGrouping() {
- DecimalFormat df = new DecimalFormat("###,###,###.00");
- List<MovementDTO> movementDTOList = new ArrayList<MovementDTO>();
- List<BigInteger> payboxListLong = this.movementRepository.getByPayBoxId();
- //Método que retorna o primeiro registro da tabela
- Movement firstMovement = this.getFirstMovement();
- for (BigInteger payboxId : payboxListLong) {
- BigDecimal sumTotalPayBox = this.movementRepository.getBySumTotalPayBox(payboxId);
- MovementDTO movementDTO = new MovementDTO();
- movementDTO.setValue(df.format(sumTotalPayBox));
- movementDTO.setDescription("Agrupado por caixa");
- movementDTO.setCreationDate(DateTime.now().getMillis());
- movementDTO
- .setCreationDateStr(new SimpleDateFormat("dd/MM HH:mm").format(DateTime.now().getMillis()) + "h");
- movementDTOList.add(movementDTO);
- }
- return movementDTOList;
- }
Add Comment
Please, Sign In to add comment