Class CompanyExcelController
java.lang.Object
es.kukenan.smartfi.microservice.backoffice.controller.CompanyExcelController
Rest service for handle temporal excel onboarding service.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAuthority (role) required in order to be able to invoke change application status.private CompanyExcelServiceCompany Excel service.private es.kukenan.smartfi.common.service.jwt.JwtServiceImplJWT service for create a bearer to call products. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgetExcelEmployeesTemplate(javax.servlet.http.HttpServletResponse response) Download excel template file.voidloadEmployeesFromExcel(Integer companyId, org.springframework.web.multipart.MultipartFile file, es.kukenan.smartfi.common.security.WalletAuthentication authentication, javax.servlet.http.HttpServletResponse response) Load an excel file with employee data from a company.
-
Field Details
-
companyExcelService
Company Excel service. -
jwtService
@Autowired private es.kukenan.smartfi.common.service.jwt.JwtServiceImpl jwtServiceJWT service for create a bearer to call products. -
API_ADMIN_AUTHORITIES
Authority (role) required in order to be able to invoke change application status.- See Also:
-
-
Constructor Details
-
CompanyExcelController
public CompanyExcelController()
-
-
Method Details
-
loadEmployeesFromExcel
@PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\'))") @PostMapping(path="/api/v1/excel") public void loadEmployeesFromExcel(@RequestParam(name="companyId",required=false) Integer companyId, @RequestPart("file") org.springframework.web.multipart.MultipartFile file, es.kukenan.smartfi.common.security.WalletAuthentication authentication, javax.servlet.http.HttpServletResponse response) throws IOException Load an excel file with employee data from a company.- Parameters:
companyId- company identifier.file- Excel file.authentication- user credentials.response- response.- Throws:
IOException- failed to write response.
-
getExcelEmployeesTemplate
@PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\'))") @GetMapping(path="/api/v1/excel/template") public void getExcelEmployeesTemplate(javax.servlet.http.HttpServletResponse response) throws IOException Download excel template file.- Parameters:
response- response.- Throws:
IOException- failed to write response.
-