Пример #1
0
 public String searchServicePriceByCategoryIdServiceId() {
   Map<String, Object> rt = new HashMap<String, Object>();
   String catalogId = ServletActionContext.getRequest().getParameter("catalogId");
   String catalogNo = ServletActionContext.getRequest().getParameter("catalogNo");
   String returnType = ServletActionContext.getRequest().getParameter("returnType");
   String serviceIdDetail = ServletActionContext.getRequest().getParameter("serviceIdDetail");
   String key = null;
   if ("serviceId".equals(returnType)) {
     key = catalogId + "_" + serviceIdDetail;
   } else {
     key = catalogId + "_" + catalogNo;
   }
   Object obj =
       SessionUtil.getOneRow(SessionPdtServ.ServicePricing.value(), sessionServiceId, key);
   if (obj != null) {
     this.servicePrice = (ServicePrice) obj;
   } else {
     if ("serviceId".equals(returnType)) {
       this.servicePrice =
           this.servService.getServicePriceByServiceIdAndCatalogId(
               catalogId, Integer.valueOf(serviceIdDetail));
     } else {
       List<com.genscript.gsscm.serv.entity.Service> serv =
           this.servService.getServiceByCatalogNo(catalogNo);
       if (serv.isEmpty()) {
         this.servicePrice = new ServicePrice();
         this.group = new ArrayList<PriceRuleGroups>();
       } else {
         this.servicePrice =
             this.servService.getServicePriceByServiceIdAndCatalogId(
                 catalogId, serv.get(0).getServiceId());
         this.group =
             this.priceRuleService.searchPriceRuleGroupListByClsId(serv.get(0).getServiceClsId());
       }
     }
   }
   Catalog catg = this.productService.getCatalogByCatalogId(catalogId);
   rt.put("priceAppr", this.getPriceAppr());
   rt.put("group", group);
   rt.put("currencyCode", catg.getCurrencyCode());
   rt.put("id", catg.getId());
   rt.put("message", SUCCESS);
   rt.put("servicePrice", servicePrice);
   Struts2Util.renderJson(rt);
   return null;
 }
Пример #2
0
 public String searchSubStepPrice() {
   Map<String, Object> rt = new HashMap<String, Object>();
   String catalogId = ServletActionContext.getRequest().getParameter("catalogId");
   String stepId = ServletActionContext.getRequest().getParameter("stepId");
   String key = catalogId + "_" + stepId;
   Object obj =
       SessionUtil.getOneRow(SessionPdtServ.ServiceSubStepPricing.value(), sessionServiceId, key);
   if (obj != null) {
     this.subStepPrice = (ServiceSubStepPrice) obj;
   } else {
     this.subStepPrice = this.servService.getSubStepPrice(catalogId, Integer.valueOf(stepId));
   }
   Catalog catg = this.productService.getCatalogByCatalogId(catalogId);
   rt.put("priceAppr", this.getPriceAppr());
   rt.put("currencyCode", catg.getCurrencyCode());
   rt.put("id", catg.getId());
   rt.put("message", SUCCESS);
   rt.put("subStepPrice", subStepPrice);
   Struts2Util.renderJson(rt);
   return null;
 }
Пример #3
0
  public String searchServicePriceByCatalogId() {
    Map<String, Object> rt = new HashMap<String, Object>();
    String catalogId = ServletActionContext.getRequest().getParameter("catalogId");
    String catalogNo = ServletActionContext.getRequest().getParameter("catalogNo");
    String returnType = ServletActionContext.getRequest().getParameter("returnType");
    String serviceIdDetail = ServletActionContext.getRequest().getParameter("serviceIdDetail");
    this.serviceBCategoryOfPriceList =
        this.servService.getServiceCategoryByCatalogId(catalogId, null, 1);
    if (serviceBCategoryOfPriceList != null && !serviceBCategoryOfPriceList.isEmpty()) {
      this.serviceCCategoryOfPriceList =
          this.servService.getServiceCategoryByCatalogId(
              catalogId, serviceBCategoryOfPriceList.get(0).getCategoryId(), 2);
      if (serviceCCategoryOfPriceList != null && !serviceCCategoryOfPriceList.isEmpty()) {
        this.serviceCategoryOfPriceList =
            this.servService.getServiceCategoryByCatalogId(
                catalogId, serviceCCategoryOfPriceList.get(0).getCategoryId(), 3);
      } else {
        this.serviceCategoryOfPriceList = new ArrayList<ServiceCategory>();
      }
    } else {
      this.serviceCCategoryOfPriceList = new ArrayList<ServiceCategory>();
      this.serviceCategoryOfPriceList = new ArrayList<ServiceCategory>();
    }

    if (serviceCategoryOfPriceList == null || serviceCategoryOfPriceList.isEmpty()) {
      this.servicePrice = new ServicePrice();
    } else {

      String key = null;
      if ("serviceId".equals(returnType)) {
        key = catalogId + "_" + serviceIdDetail;
      } else {
        key = catalogId + "_" + catalogNo;
      }
      Object obj =
          SessionUtil.getOneRow(SessionPdtServ.ServicePricing.value(), sessionServiceId, key);
      if (obj != null) {
        this.servicePrice = (ServicePrice) obj;
        if (servicePrice != null && servicePrice.getCategoryId() != null) {
          ServiceCategory pcategory =
              this.servService.getServiceCategoryDetail(servicePrice.getCategoryId());
          if (pcategory != null && pcategory.getParentCatId() != null) {
            ServiceCategory ccategory =
                this.servService.getServiceCategoryDetail(pcategory.getParentCatId());
            if (ccategory != null) {
              this.ccategoryId = ccategory.getCategoryId();
              if (ccategory.getParentCatId() != null) {
                ServiceCategory bcategory =
                    this.servService.getServiceCategoryDetail(ccategory.getParentCatId());
                if (bcategory != null) {
                  this.bcategoryId = bcategory.getCategoryId();
                }
              }
            }
          }
        }
      } else {
        if ("serviceId".equals(returnType)) {
          this.servicePrice =
              this.servService.getServicePriceByServiceIdAndCatalogId(
                  catalogId, Integer.valueOf(serviceIdDetail));
          if (servicePrice != null && servicePrice.getCategoryId() != null) {
            ServiceCategory pcategory =
                this.servService.getServiceCategoryDetail(servicePrice.getCategoryId());
            if (pcategory != null && pcategory.getParentCatId() != null) {
              ServiceCategory ccategory =
                  this.servService.getServiceCategoryDetail(pcategory.getParentCatId());
              if (ccategory != null) {
                this.ccategoryId = ccategory.getCategoryId();
                if (ccategory.getParentCatId() != null) {
                  ServiceCategory bcategory =
                      this.servService.getServiceCategoryDetail(ccategory.getParentCatId());
                  if (bcategory != null) {
                    this.bcategoryId = bcategory.getCategoryId();
                  }
                }
              }
            }
          }
        } else {
          List<com.genscript.gsscm.serv.entity.Service> serv =
              this.servService.getServiceByCatalogNo(catalogNo);
          if (serv.isEmpty()) {
            this.servicePrice = new ServicePrice();
          } else {
            this.servicePrice =
                this.servService.getServicePriceByServiceIdAndCatalogId(
                    catalogId, serv.get(0).getServiceId());
          }
        }
      }
    }
    Catalog catg = this.productService.getCatalogByCatalogId(catalogId);
    rt.put("priceAppr", this.getPriceAppr());
    rt.put("serviceCategoryOfPriceList", serviceCategoryOfPriceList);
    rt.put("serviceBCategoryOfPriceList", serviceBCategoryOfPriceList);
    rt.put("serviceCCategoryOfPriceList", serviceCCategoryOfPriceList);
    rt.put("ccategoryId", this.ccategoryId);
    rt.put("bcategoryId", this.bcategoryId);
    rt.put("currencyCode", catg.getCurrencyCode());
    rt.put("id", catg.getId());
    rt.put("message", SUCCESS);
    rt.put("servicePrice", servicePrice);
    Struts2Util.renderJson(rt);
    return null;
  }