Bonjour à tous
Je suis débutant en srping te je travaille avec springboot et je suis actuellement bloquer sur une fonctionnalité.
Je dois faire un tableau me ramenant plusieurs resultat de calcul par produits
détails:
pour chaque produit de la table produit
je doit avoir le résultat suivant (juste un exemple):
Produit A | Proudit B| Produit C| produit D| ..
Somme des quantité vendus xxx | xxxx | xxxx | xxxx | ...
Montant Total des vente xxx | xxxx | xxxx | xxxx | ...
Somme des quantité Perdue xxx | xxxx | xxxx | xxxx | ...
Montant vente à crédit xxx | xxxx | xxxx | xxxx | ...
Somme des quantité à crédit xxx | xxxx | xxxx | xxxx | ...
Montant ventes cash xxx | xxxx | xxxx | xxxx | ...
...
Ma table produit est lié à ma table Ligne_Bon_de_sortie (quantite, prixvente ,...) qui est lié a la table Bon_de_sortie(typesortie, typeVente,..)
Si j'arrive à avoir séparément les différents résultats en ligne dans le tableau, je ne sais pas comment faire pour avoir le tableau tel que vous le voyez.
J'ai besoin de votre aide s'il vous plais
voici le code de
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 public interface LigneBonDeSortieService { /** * Save a ligneBonDeSortie. * * @param ligneBonDeSortie the entity to save * @return the persisted entity */ LigneBonDeSortie save(LigneBonDeSortie ligneBonDeSortie); /** * Get all the ligneBonDeSorties. * * @param pageable the pagination information * @return the list of entities */ Page<LigneBonDeSortie> findAll(Pageable pageable); /** * Get the "id" ligneBonDeSortie. * * @param id the id of the entity * @return the entity */ LigneBonDeSortie findOne(Long id); /** * Delete the "id" ligneBonDeSortie. * * @param id the id of the entity */ void delete(Long id); /** * Search for the ligneBonDeSortie corresponding to the query. * * @param query the query of the search * @param pageable * @return the list of entities */ Page<LigneBonDeSortie> search(String query, Pageable pageable); List<LigneBonDeSortie> chiffreAffaireParProduit( String dateDebutPeriode, String dateFinPeriode ); List<LigneBonDeSortie> getQuantiteProduitVendueMois(String dateDebutMois, String dateFinMois); List<LigneBonDeSortie> getQuantiteProduitPromotionMois(String dateDebutMois, String dateFinMois); List<LigneBonDeSortie> getQuantiteProduitVendueACreditMois(String dateDebutMois, String dateFinMois); List<LigneBonDeSortie> getQuantiteProduitVendueCashMois(String dateDebutMois, String dateFinMois); List<LigneBonDeSortie> getValeurVenteQuantiteProduitACreditMois(String dateDebutMois, String dateFinMois); List<LigneBonDeSortie> getValeurVenteQuantiteProduitCashMois(String dateDebutMois, String dateFinMois); }
LigneBonDeSortieServiceImpl
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49 @Service @Transactional public class LigneBonDeSortieServiceImpl implements LigneBonDeSortieService{ private final Logger log = LoggerFactory.getLogger(LigneBonDeSortieServiceImpl.class); @Inject private LigneBonDeSortieRepository ligneBonDeSortieRepository; @Inject private LigneBonDeSortieSearchRepository ligneBonDeSortieSearchRepository; @Override public List<LigneBonDeSortie> chiffreAffaireParProduit(String dateDebutPeriode, String dateFinPeriode) { return ligneBonDeSortieRepository.findChiffreAffaireByProduit(dateDebutPeriode, dateFinPeriode); } @Override public List<LigneBonDeSortie> getQuantiteProduitVendueMois(String dateDebutMois, String dateFinMois) { return ligneBonDeSortieRepository.quantiteProduitVendueDuMois(dateDebutMois, dateFinMois); } @Override public List<LigneBonDeSortie> getQuantiteProduitPromotionMois(String dateDebutMois, String dateFinMois) { return ligneBonDeSortieRepository.quantiteProduitPromotionDuMois(dateDebutMois, dateFinMois); } @Override public List<LigneBonDeSortie> getQuantiteProduitVendueACreditMois(String dateDebutMois, String dateFinMois) { return ligneBonDeSortieRepository.quantiteProduitVendueCREDITDuMois(dateDebutMois, dateFinMois); } @Override public List<LigneBonDeSortie> getValeurVenteQuantiteProduitACreditMois(String dateDebutMois, String dateFinMois) { return ligneBonDeSortieRepository.valeurVenteCREDITDuMois(dateDebutMois, dateFinMois); } @Override public List<LigneBonDeSortie> getQuantiteProduitVendueCashMois(String dateDebutMois, String dateFinMois) { return ligneBonDeSortieRepository.quantiteProduitVendueCASHDuMois(dateDebutMois, dateFinMois); } @Override public List<LigneBonDeSortie> getValeurVenteQuantiteProduitCashMois(String dateDebutMois, String dateFinMois) { return ligneBonDeSortieRepository.valeurVenteCASHDuMois(dateDebutMois, dateFinMois); }
Merci
Partager