Aggiunto un flag per l'export delle descrizioni dei codici assenza
This commit is contained in:
parent
aa8bc423e8
commit
7b81ef8be3
|
@ -84,6 +84,8 @@ public class SyncService {
|
|||
private static final String SI_TIPO_EMAIL_CNR = "C.N.R.";
|
||||
private static final String PERSON_DEFAULT_QUALIFICATION = "3";
|
||||
|
||||
private static final boolean EXPORT_ABSENCE_CODE_DESCRIPTION = false;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SyncService.class);
|
||||
private final SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
|
@ -1196,8 +1198,10 @@ public class SyncService {
|
|||
EPASTimeCards epasTimeCards = epasTimeCardsService.getTimeCardByPersonFiscalCode(person.getFiscalCode(),
|
||||
year, month);
|
||||
|
||||
LinkedHashMap<String, String> epasAbsenceTypeMap = epasAbsenceTypeService.getAbsenceTypesMap();
|
||||
|
||||
LinkedHashMap<String, String> epasAbsenceTypeMap = null;
|
||||
if (EXPORT_ABSENCE_CODE_DESCRIPTION) {
|
||||
epasAbsenceTypeMap = epasAbsenceTypeService.getAbsenceTypesMap();
|
||||
}
|
||||
EPASPersons epasPerson = epasTimeCards.getPerson();
|
||||
Integer personId = Integer.valueOf(epasPerson.getId());
|
||||
|
||||
|
@ -1271,7 +1275,11 @@ public class SyncService {
|
|||
EPASTimeCards epasTimeCards = epasTimeCardsService.getTimeCardByPersonFiscalCode(person.getFiscalCode(), year,
|
||||
month);
|
||||
|
||||
LinkedHashMap<String, String> epasAbsenceTypeMap = epasAbsenceTypeService.getAbsenceTypesMap();
|
||||
LinkedHashMap<String, String> epasAbsenceTypeMap = null;
|
||||
if (EXPORT_ABSENCE_CODE_DESCRIPTION) {
|
||||
epasAbsenceTypeMap = epasAbsenceTypeService.getAbsenceTypesMap();
|
||||
}
|
||||
|
||||
EPASPersons epasPerson = epasTimeCards.getPerson();
|
||||
Integer personId = Integer.valueOf(epasPerson.getId());
|
||||
|
||||
|
@ -1373,8 +1381,7 @@ public class SyncService {
|
|||
|
||||
}
|
||||
|
||||
private void extractMotivoInfo(EPASPersonDays epasPersonDay,
|
||||
LinkedHashMap<String, String> epasAbsenceTypeMap,
|
||||
private void extractMotivoInfo(EPASPersonDays epasPersonDay, LinkedHashMap<String, String> epasAbsenceTypeMap,
|
||||
StringBuilder motivo) {
|
||||
if (epasPersonDay.getIsHoliday()) {
|
||||
motivo.append("[Festivo]");
|
||||
|
@ -1413,11 +1420,13 @@ public class SyncService {
|
|||
// motivo.append("-");
|
||||
motivo.append(epasAbsences.getCode());
|
||||
|
||||
String description=epasAbsenceTypeMap.get(epasAbsences.getCode());
|
||||
if(description!=null && !description.isEmpty()) {
|
||||
if (epasAbsenceTypeMap != null && !epasAbsenceTypeMap.isEmpty()) {
|
||||
String description = epasAbsenceTypeMap.get(epasAbsences.getCode());
|
||||
if (description != null && !description.isEmpty()) {
|
||||
motivo.append("-");
|
||||
motivo.append(description);
|
||||
}
|
||||
}
|
||||
if (epasAbsences.getNote() != null && !epasAbsences.getNote().isEmpty()) {
|
||||
motivo.append("-");
|
||||
motivo.append(epasAbsences.getNote());
|
||||
|
|
|
@ -29,7 +29,7 @@ public class SyncResourceIT {
|
|||
|
||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||
private static final String YEAR = "2022";
|
||||
private static final String MONTH = "7";
|
||||
private static final String MONTH = "9";
|
||||
private static final String PERSON_DEFAULT_FISCAL_CODE = "CSTDTL57L65A864M";
|
||||
|
||||
@Autowired
|
||||
|
|
Loading…
Reference in New Issue