Bonjour,

je récupére un json via un web service.

je mappe le json via la librairie Jakson,

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
JSONObject obj = new JSONObject(response);
resultobj = obj.getJSONObject("result").toString();
dataModelArrayListProduit = new ArrayList<>();
final ObjectMapper mapper = new ObjectMapper();
result = mapper.readValue(resultobj, Result.class);
Et je souhaite modifier la valeur quantiteASortir du produit BAR SURGELE,
Au lieu de 15.00 mettre 16.00 par exemple


le json est le suivant

Code json : 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
	"jsonrpc": "2.0",
	"result": {
		"nomcuisine": "UCP_HOPITAL",
		"numeroCuisine": "1",
		"produits": [
			{
				"code": "DPS004",
				"nom": "BAR SURGELE",
				"unite": "KG",
				"zoneDeStockage": {
					"nom": "CF NEGATIVE",
					"id": "2"
				},
				"lotsArticles": [
					{
						"dlc": "//",
						"idTracabiliteArticle": "",
						"idTracabiliteFournisseur": "",
						"unite": "KG",
						"quantiteASortir": "15.00",
						"quantiteDejaSortie": "0.00",
						"quantiteResteASortir": "15.00",
						"quantiteEnStock": "0.00"
					}
				],
				"quantiteASortir": "15.00",
				"quantiteDejaSortie": "0.00",
				"quantiteResteASortir": "15.00",
				"quantiteEnStock": "0.00",
				"ordreDeProduction": [
					{
						"OP": "",
						"date": "29/10/2019",
						"atelier": "PRODUCTION CHAUDE",
						"code": "PPP002.SSL",
						"plat": "FILET DE BAR A L HUILE D OLIVE SANS SEL",
						"unite": "POR",
						"quantiteInitiale": "0.00",
						"quantiteAjustee": "0.00"
					}
				]
			},
			{
				"code": "DYC002",
				"nom": "BEURRE PLAQUETTE 250 GR",
				"unite": "KG",
				"zoneDeStockage": {
					"nom": "BOF",
					"id": "8"
				},
				"lotsArticles": [
					{
						"dlc": "21/07/2019",
						"idTracabiliteArticle": "11722019DYC002",
						"idTracabiliteFournisseur": "",
						"unite": "KG",
						"quantiteASortir": "1.00",
						"quantiteDejaSortie": "0.00",
						"quantiteResteASortir": "1.00",
						"quantiteEnStock": "1.00"
					}
				],
				"quantiteASortir": "4.50",
				"quantiteDejaSortie": "0.00",
				"quantiteResteASortir": "4.50",
				"quantiteEnStock": "10.00",
				"ordreDeProduction": [
					{
						"OP": "",
						"date": "29/10/2019",
						"atelier": "PRODUCTION CHAUDE",
						"code": "PGF003",
						"plat": "RIZ CREOLE",
						"unite": "POR",
						"quantiteInitiale": "0.00",
						"quantiteAjustee": "0.00"
					}
				]
			}
		]
	},
	"id": "c6c4"
}

j'arrive bien a naviguer en choisissant le produit, mais je ne sais pas comment le mettre a jour afin que si je modifie un ou plusieurs produit, mon objet mapper est a jour.

Merci d'avance