Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rest-tutoriel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Remy Piazza
rest-tutoriel
Commits
24139ffc
Commit
24139ffc
authored
3 years ago
by
remy.piazza.etu
Browse files
Options
Downloads
Patches
Plain Diff
Fin Tp
parent
7bcb1fd9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/fr/ulille/iut/tva/ressource/TvaRessource.java
+10
-7
10 additions, 7 deletions
src/main/java/fr/ulille/iut/tva/ressource/TvaRessource.java
with
10 additions
and
7 deletions
src/main/java/fr/ulille/iut/tva/ressource/TvaRessource.java
+
10
−
7
View file @
24139ffc
...
...
@@ -9,7 +9,10 @@ import fr.ulille.iut.tva.service.TauxTva;
import
jakarta.ws.rs.GET
;
import
jakarta.ws.rs.Path
;
import
jakarta.ws.rs.PathParam
;
import
jakarta.ws.rs.Produces
;
import
jakarta.ws.rs.QueryParam
;
import
jakarta.ws.rs.core.MediaType
;
import
jakarta.xml.bind.annotation.XmlRootElement
;
/**
* TvaRessource
...
...
@@ -58,15 +61,15 @@ public class TvaRessource {
@GET
@Path
(
"details/{taux}"
)
public
List
<
String
>
getDetail
(
@PathParam
(
"taux"
)
String
niveau
,
@QueryParam
(
"somme"
)
int
somme
)
{
List
<
String
>
res
=
new
ArrayList
<
String
>();
@Produces
({
MediaType
.
APPLICATION_JSON
,
MediaType
.
APPLICATION_XML
})
public
List
<
InfoTauxDto
>
getDetail
(
@PathParam
(
"taux"
)
String
niveau
,
@QueryParam
(
"somme"
)
int
somme
)
{
List
<
InfoTauxDto
>
res
=
new
ArrayList
<
InfoTauxDto
>();
double
montantTotal
=
(
new
CalculTva
()).
calculerMontant
(
TauxTva
.
valueOf
(
niveau
.
toUpperCase
())
,
somme
);
res
.
add
(
"Montant total
: "
+
montantTotal
)
;
res
.
add
(
new
InfoTauxDto
(
"Montant total
"
,
montantTotal
))
;
double
montantTVA
=
somme
*
(
TauxTva
.
valueOf
(
niveau
.
toUpperCase
()).
taux
/
100
);
res
.
add
(
"Montant TVA: "
+
montantTVA
);
res
.
add
(
"Somme: "
+
somme
);
res
.
add
(
"tauxLabel: "
+
TauxTva
.
valueOf
(
niveau
.
toUpperCase
())
);
res
.
add
(
"tauxValue: "
+
TauxTva
.
valueOf
(
niveau
.
toUpperCase
()).
taux
);
res
.
add
(
new
InfoTauxDto
(
"Montant TVA: "
,
montantTVA
));
//res.add(new InfoTauxDto("tauxLabel: " , TauxTva.valueOf(niveau.toUpperCase()) )) ;
res
.
add
(
new
InfoTauxDto
(
"tauxValue:: "
,
TauxTva
.
valueOf
(
niveau
.
toUpperCase
()).
taux
));
return
res
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment