-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDipendente.py
More file actions
71 lines (62 loc) · 2.33 KB
/
Dipendente.py
File metadata and controls
71 lines (62 loc) · 2.33 KB
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
from ast import match_case
class Dipendente(Lavoratore):
def __init__(self,nome, cognome, data_nascita, sesso, peso, idbadge, mansione, livello):
super().__init__(nome, cognome, data_nascita, sesso, peso, idbadge, mansione)
self._livello = livello
logger.info("E' stato inserito un dipendente.")
def __str__(self):
return super().__str__() + ' ' + self._livello
def __eq__(self, other):
if isinstance(other, Dipendente):
if super().__eq__(other) and other._livello == self._livello:
return True
return False
def __hash__(self):
return hash((super().__hash__(), self._livello))
def get_livello(self):
return self._livello
def set_idbadge(self, x):
Lavoratore.check_id(x)
self._livello = x
@staticmethod
def check_liv(liv):
if isinstance(liv,int) and liv>0:
pass
else:
raise('Inserire un livello corretto')
def calcolo_stipendio(self, mansione, livl):
item = [mansione, livl]
match item:
case [7, 'addetto pulizie']:
stipendio = 1275.00
case [7, 'inserviente']:
stipendio = 1230.00
case [6, 'operaio comune']:
stipendio = 1392.00
case [6, 'fattorino']:
stipendio = 1359.00
case [5, 'impiegato']:
stipendio = 1476.00
case [5, 'operaio qualificato']:
stipendio = 1494.00
case [4, "impiegato d'ordine"]:
stipendio = 1600.00
case [4, 'operaio specialzzato']:
stipendio = 1610.00
case [3, 'impiegato di concetto']:
stipendio = 1772.00
case [3, 'operaio specializzato provetto']:
stipendio = 1789.00
case [2, 'impiegato autonomo']:
stipendio = 1988.00
case [2, 'impiegato direttivo']:
stipendio = 1979.00
case [1, 'manager']:
stipendio = 2670.00
case [1, 'direttore']:
stipendio = 2790.00
case [1, 'responsabile']:
stipendio = 2390.00
case _:
return ("Errore nel calcolo dello stipendio")
return stipendio