package pwc.taxtech.atms.controller; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.vatdto.QueryImportType; import pwc.taxtech.atms.entity.PeriodInfo; import pwc.taxtech.atms.service.IdentityService; import pwc.taxtech.atms.service.ProjectInfoService; import java.util.List; @RestController @RequestMapping("/api/v1/ProjectInfo") public class ProjectInfoController { @Autowired private ProjectInfoService projectInfoService; @Autowired private IdentityService identityService; @ApiOperation(value = "isProjectImportedData", notes = "") @RequestMapping(value = "isProjectImportedData/{projectId}/{serviceType}/{importTypeId}", method = RequestMethod.GET) public @ResponseBody OperationResultDto<Boolean> isProjectImportedData(@PathVariable String projectId, @PathVariable Integer serviceType, @PathVariable Integer importTypeId) { return projectInfoService.isProjectImportedData(projectId, serviceType, importTypeId); } @ApiOperation(value = "isProjectImportedData", notes = "") @RequestMapping(value = "isProjectImportedData/{projectId}/{importTypeId}", method = RequestMethod.GET) public @ResponseBody OperationResultDto<Boolean> isProjectImportedData(@PathVariable String projectId, @PathVariable Integer importTypeId) { return projectInfoService.isProjectImportedData(projectId, importTypeId); } @ApiOperation(value = "getProjectImportType", notes = "") @RequestMapping(value = "getProjectImportType", method = RequestMethod.POST) public OperationResultDto<List<PeriodInfo>> getProjectImportType(@RequestBody QueryImportType queryImportType) { return projectInfoService.getProjectImportType(queryImportType.getProjectId(), queryImportType.getPeriods(), queryImportType.getServiceTypeId() , identityService.getIdentityUser().getId()); } @ApiOperation(value = "getImportType", notes = "") @RequestMapping(value = "getImportType/{projectId}/{periodId}/{serviceType}", method = RequestMethod.GET) public ResponseEntity getImportType(@PathVariable String projectId, @PathVariable Integer periodId, @PathVariable Integer serviceType) { return ResponseEntity.ok().body(projectInfoService.getImportType(projectId, periodId, identityService.getIdentityUser().getId(), serviceType)); } }