コード例 #1
0
ファイル: ServicePricingAction.java プロジェクト: zskang/scm
  public String saveServicePriceToSession() throws Exception {
    Map<String, Object> rt = new HashMap<String, Object>();
    String returnType = ServletActionContext.getRequest().getParameter("returnType");
    String serviceIdDetail = ServletActionContext.getRequest().getParameter("serviceIdDetail");
    String catalogNo = ServletActionContext.getRequest().getParameter("catalogNo");
    String key = null;
    if ("serviceId".equals(returnType)) {
      servicePrice.setServiceId(Integer.valueOf(serviceIdDetail));
      key = servicePrice.getCatalogId() + "_" + servicePrice.getServiceId();
    } else {
      List<com.genscript.gsscm.serv.entity.Service> serv =
          this.servService.getServiceByCatalogNo(catalogNo);
      servicePrice.setServiceId(serv.get(0).getServiceId());
      key = servicePrice.getCatalogId() + "_" + catalogNo;
    }

    ServicePrice sp =
        this.servService.getServicePriceByServiceIdAndCatalogId(
            servicePrice.getCatalogId(), servicePrice.getServiceId());
    if (sp == null) {
      sp = servicePrice;
    } else {
      sp.setLimitPrice(servicePrice.getLimitPrice());
      sp.setStandardPrice(servicePrice.getStandardPrice());
      sp.setPriceRuleGroup(servicePrice.getPriceRuleGroup());
      sp.setCategoryId(servicePrice.getCategoryId());
    }
    SessionUtil.updateOneRow(SessionPdtServ.ServicePricing.value(), sessionServiceId, key, sp);
    rt.put("key", key);
    rt.put("message", SUCCESS);
    Struts2Util.renderJson(rt);
    return null;
  }
コード例 #2
0
ファイル: ServicePricingAction.java プロジェクト: zskang/scm
  public String priceApprovedSaveSession() {
    Map<String, Object> rt = new HashMap<String, Object>();
    String key = Struts2Util.getParameter("priceId");
    String approved = Struts2Util.getParameter("approved");
    String groupApproved = Struts2Util.getParameter("groupApproved");
    String approvedReason = Struts2Util.getParameter("approvedReason");
    String oldVal = Struts2Util.getParameter("oldPriceApproved");
    ServicePriceDTO dto = new ServicePriceDTO();
    if (key == null) {
      key = Struts2Util.getParameter("subPriceId");
      if (key != null) {
        dto.setPriceId(Integer.valueOf(key));
        dto.setServiceSubPriceApprove(Double.valueOf(approved));
        dto.setServicePriceReason(approvedReason);
        dto.setServicePriceOldVal(Double.valueOf(oldVal));
        SessionUtil.updateOneRow(
            SessionPdtServ.ServiceSubPriceApproved.value(), sessionServiceId, key, dto);
        rt.put("key", key);
      }
    } else {
      dto.setPriceId(Integer.valueOf(key));
      if (groupApproved != null && !groupApproved.equals("")) {
        dto.setServiceRuleGroupPriceApprove(Integer.valueOf(groupApproved));
      }
      if (approved != null && !approved.equals("")) {
        dto.setServicePriceApprove(Double.valueOf(approved));
      }
      dto.setServicePriceReason(approvedReason);
      if (oldVal != null && !oldVal.equals("")) {
        dto.setServicePriceOldVal(Double.valueOf(oldVal));
      } else {
        dto.setServicePriceOldVal(Double.valueOf(0));
      }

      SessionUtil.updateOneRow(
          SessionPdtServ.ServicePriceApproved.value(), sessionServiceId, key, dto);
      rt.put("key", key);
    }

    rt.put("message", SUCCESS);
    Struts2Util.renderJson(rt);
    return null;
  }
コード例 #3
0
ファイル: ServicePricingAction.java プロジェクト: zskang/scm
 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;
 }