Example #1
0
 public String saveServiceSubStepPriceToSession() throws Exception {
   Map<String, Object> rt = new HashMap<String, Object>();
   String key = subStepPrice.getCatalogId() + "_" + subStepPrice.getStepId();
   ServiceSubStepPrice sssp =
       this.servService.getSubStepPrice(subStepPrice.getCatalogId(), subStepPrice.getStepId());
   if (sssp == null) {
     sssp = subStepPrice;
   } else {
     sssp.setLimitPrice(subStepPrice.getLimitPrice());
     sssp.setRetailPrice(subStepPrice.getRetailPrice());
     sssp.setCatalogId(subStepPrice.getCatalogId());
   }
   SessionUtil.updateOneRow(
       SessionPdtServ.ServiceSubStepPricing.value(), sessionServiceId, key, sssp);
   rt.put("key", key);
   rt.put("message", SUCCESS);
   Struts2Util.renderJson(rt);
   return null;
 }
Example #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;
 }