Aggiornata sync per exportare le descrizioni delle assenze

This commit is contained in:
Giancarlo Panichi 2022-11-14 15:48:35 +01:00
parent 3255e335b6
commit 3c01bf39b8
4 changed files with 29 additions and 34 deletions

View File

@ -102,7 +102,7 @@ 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 boolean EXPORT_ABSENCE_CODE_DESCRIPTION = true;
private static final Logger logger = LoggerFactory.getLogger(SyncService.class);
private final SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");

View File

@ -72,7 +72,8 @@ public class SyncResource {
*
*/
@GetMapping("/sync/writes")
@PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.ADMIN + "\",\""+AuthoritiesConstants.USER+"\")")
@PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.ADMIN + "\") or hasAuthority(\"" + AuthoritiesConstants.USER
+ "\")")
public ResponseEntity<Void> syncWrites(@RequestParam("year") String year, @RequestParam("month") String month)
throws Exception {
logger.info("REST request syncWrites");
@ -87,7 +88,8 @@ public class SyncResource {
}
/**
* {@code GET /sync/writesscheduled} : Report from ePAS and update SistemaInformativo scheduled info.
* {@code GET /sync/writesscheduled} : Report from ePAS and update
* SistemaInformativo scheduled info.
*
* @param year the year.
* @param month the month.
@ -98,9 +100,10 @@ public class SyncResource {
*
*/
@GetMapping("/sync/writesscheduled")
@PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.ADMIN + "\",\""+AuthoritiesConstants.USER+"\")")
public ResponseEntity<Void> syncWritesScheduled(@RequestParam("year") String year, @RequestParam("month") String month)
throws Exception {
@PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.ADMIN + "\") or hasAuthority(\"" + AuthoritiesConstants.USER
+ "\")")
public ResponseEntity<Void> syncWritesScheduled(@RequestParam("year") String year,
@RequestParam("month") String month) throws Exception {
logger.info("REST request syncWritesScheduled");
ResponseEntity<Void> res;
@ -112,9 +115,6 @@ public class SyncResource {
return res;
}
/**
* {@code GET /sync/test} : Test api.
*
@ -195,10 +195,9 @@ public class SyncResource {
return res;
}
/**
* {@code GET /sync/writesSingleTimeCards} : Reports SingleTimeCards from ePAS in
* SistemaInformativo.
* {@code GET /sync/writesSingleTimeCards} : Reports SingleTimeCards from ePAS
* in SistemaInformativo.
*
* @param year the year.
* @param month the month.
@ -222,8 +221,6 @@ public class SyncResource {
return res;
}
/**
* {@code GET /sync/writesOffSiteWorks} : Reports Off Site Works from ePAS in
* SistemaInformativo.
@ -250,7 +247,6 @@ public class SyncResource {
return res;
}
/**
* {@code GET /sync/writesLeaves} : Reports Leaves from ePAS in
* SistemaInformativo.
@ -265,8 +261,8 @@ public class SyncResource {
*/
@GetMapping("/sync/writesLeaves")
@PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.ADMIN + "\")")
public ResponseEntity<Void> syncWritesLeaves(@RequestParam("year") String year,
@RequestParam("month") String month) throws Exception {
public ResponseEntity<Void> syncWritesLeaves(@RequestParam("year") String year, @RequestParam("month") String month)
throws Exception {
logger.info("REST request syncWritesLeaves)");
ResponseEntity<Void> res;
syncService.executeWritesLeaves(year, month);
@ -278,8 +274,8 @@ public class SyncResource {
}
/**
* {@code GET /sync/writesPersonWorkingTime} : Reports Person Working Time from ePAS in
* SistemaInformativo.
* {@code GET /sync/writesPersonWorkingTime} : Reports Person Working Time from
* ePAS in SistemaInformativo.
*
* @param year the year.
* @param month the month.
@ -303,5 +299,4 @@ public class SyncResource {
return res;
}
}

View File

@ -62,8 +62,8 @@ public class EPASContractsResourceIT {
private static final String PERSON_DEFAULT_ID = "1";
private static final String PERSON_DEFAULT_NAME = "Giancarlo";
private static final String PERSON_DEFAULT_SURNAME = "Panichi";
private static final String PERSON_DEFAULT_FISCAL_CODE = "MTAGPP68D15D976W"; // "MROGLI68H29E625F";
// //"PNCGCR75S04L103G";
private static final String PERSON_DEFAULT_FISCAL_CODE = "PNCGCR75S04L103G";//"MTAGPP68D15D976W"; // "MROGLI68H29E625F";
// "PNCGCR75S04L103G";
private static final String PERSON_DEFAULT_EMAIL = "giancarlo.panichi@cnr.it";
private static final String PERSON_DEFAULT_QUALIFICATION = "6";

View File

@ -40,7 +40,7 @@ public class SyncResourceIT {
private final Logger log = LoggerFactory.getLogger(getClass());
private static final String YEAR = "2022";
private static final String MONTH = "9";
private static final String MONTH = "10";
private static final String PERSON_DEFAULT_FISCAL_CODE = "CSTDTL57L65A864M";
@Autowired