예제 #1
0
  @GET
  @Path("{taxMapId}")
  @Consumes({MediaType.APPLICATION_JSON})
  @Produces({MediaType.APPLICATION_JSON})
  public String retrievedSingleTaxMap(
      @PathParam("taxMapId") final Long taxMapId, @Context final UriInfo uriInfo) {

    context.authenticatedUser().validateHasReadPermission(resourceNameForPermissions);
    TaxMapData taxMapData = taxMapReadPlatformService.retrievedSingleTaxMapData(taxMapId);
    final ApiRequestJsonSerializationSettings settings =
        apiRequestParameterHelper.process(uriInfo.getQueryParameters());
    if (settings.isTemplate()) {
      final List<ChargeCodeData> chargeCodeData =
          this.taxMapReadPlatformService.retrivedChargeCodeTemplateData();
      final Collection<MCodeData> taxTypeData =
          this.mCodeReadPlatformService.getCodeValue(CodeNameConstants.CODE_TYPE);
      final List<PriceRegionData> priceRegionData =
          this.regionalPriceReadplatformService.getPriceRegionsDetails();
      taxMapData.setChargeCodesForTax(chargeCodeData);
      taxMapData.setTaxTypeData(taxTypeData);
      taxMapData.setPriceRegionData(priceRegionData);
      taxMapData.setDate(DateUtils.getLocalDateOfTenantForClient());
    }
    return this.apiJsonSerializer.serialize(settings, taxMapData, RESPONSE_TAXMAPPING_PARAMETERS);
  }
예제 #2
0
  @GET
  @Path("{chargCode}/chargetax")
  @Consumes({MediaType.APPLICATION_JSON})
  @Produces({MediaType.APPLICATION_JSON})
  public String retriveTaxDetailsForChargeCode(
      @PathParam("chargCode") final String chargeCode, @Context final UriInfo uriInfo) {

    context.authenticatedUser().validateHasReadPermission(resourceNameForPermissions);
    final List<TaxMapData> taxMapData = taxMapReadPlatformService.retriveTaxMapData(chargeCode);
    final ApiRequestJsonSerializationSettings settings =
        apiRequestParameterHelper.process(uriInfo.getQueryParameters());
    return this.apiJsonSerializer.serialize(settings, taxMapData, RESPONSE_TAXMAPPING_PARAMETERS);
  }