コード例 #1
0
 /**
  * 展示修改人数.
  *
  * @param ordOrder
  */
 public void showTotalQuantity(List<OrdOrderItemMeta> orderItemMetas) {
   long child = 0;
   long adult = 0;
   long totalPrice = 0;
   OrdOrder ordOrder =
       orderServiceProxy.queryOrdOrderByOrderId(orderItemMetas.get(0).getOrderId());
   for (OrdOrderItemMeta orderItemMeta : orderItemMetas) {
     adult += orderItemMeta.getTotalAdultQuantity();
     child += orderItemMeta.getTotalChildQuantity();
     long price = 0;
     for (OrdOrderItemProd ordOrderItemProd : ordOrder.getOrdOrderItemProds()) {
       if (ordOrderItemProd.getOrderItemProdId().equals(orderItemMeta.getOrderItemId())) {
         price = ordOrderItemProd.getPrice();
         break;
       }
     }
     totalPrice += price * orderItemMeta.getQuantity();
   }
   showTotalQuantity.setValue(
       "总人数:" + (child + adult) + "            (成人" + adult + " 儿童" + child + ")");
   passPortInfo.setAdult(adult);
   passPortInfo.setChild(child);
   passPortInfo.setPrice(totalPrice);
   passPortInfo.setPriceYuan(String.valueOf((totalPrice / 100)));
   this.showTotalPrice.setValue(passPortInfo.getPriceYuan());
 }
コード例 #2
0
  private void singleSmsInMerged(PassCode passCode, boolean mergeCertificateSMS) {
    List<OrdOrderItemMeta> ordItemMetaList = null;
    OrdOrderItemMeta itemMeta = null;
    if (passCode.isForOrder()) {
      ordItemMetaList = orderServiceProxy.queryOrdOrderItemMetaByOrderId(passCode.getOrderId());
      itemMeta = ordItemMetaList.get(0);
    } else {
      itemMeta = orderServiceProxy.queryOrdOrderItemMetaBy(passCode.getObjectId());
    }
    OrdOrderItemProd ordItemProd =
        orderServiceProxy.queryOrdOrderItemProdById(itemMeta.getOrderItemId());
    ProdProductBranch prodProductBranch =
        prodProductBranchDAO.selectByPrimaryKey(ordItemProd.getProdBranchId());

    // 凭证短信合并发送,并且是各子子项独立申码
    if (mergeCertificateSMS && passCode.isForOrderItemMeta() && generateSMS) {
      // 【${销售类别} 取票码 ${code},辅助码xxxx ,含${adult} ${chaild}】
      String formatString = "【%s %s,%s,%s】";

      String branchName = prodProductBranch.getBranchName();
      String code = "";
      if (!"BASE64".equalsIgnoreCase(passCode.getCode())) {
        code = "取票码 " + passCode.getCode();
      }
      String addCode = passCode.getAddCode();

      if (StringUtils.isNotEmpty(addCode)) {
        addCode = "辅助码 " + addCode;
      } else {
        addCode = "";
      }

      long adult = ordItemProd.getQuantity() * prodProductBranch.getAdultQuantity();
      long child = ordItemProd.getQuantity() * prodProductBranch.getChildQuantity();

      StringBuilder quantity = new StringBuilder();
      if (itemMeta.isStudent()) {
        quantity.append("学生人数:" + (adult + child));
      } else {
        quantity.append("含");
        if (adult > 0) {
          quantity.append(adult + "成人  ");
        }
        if (child > 0) {
          quantity.append(child + "儿童");
        }
      }
      String smsContent = String.format(formatString, branchName, code, addCode, quantity);
      log.info("=====singleSmsInMerged smsContent===========" + smsContent);
      PassCode temp = new PassCode();
      temp.setCodeId(passCode.getCodeId());
      temp.setSmsContent(smsContent);
      passCodeService.updatePassCode(temp);
    }
  }
コード例 #3
0
 private String getProductName(PassCode passCode) {
   List<OrdOrderItemMeta> ordItemMetaList = null;
   OrdOrderItemMeta itemMeta = null;
   if (passCode.isForOrder()) {
     ordItemMetaList = orderServiceProxy.queryOrdOrderItemMetaByOrderId(passCode.getOrderId());
     itemMeta = ordItemMetaList.get(0);
   } else {
     itemMeta = orderServiceProxy.queryOrdOrderItemMetaBy(passCode.getObjectId());
   }
   OrdOrderItemProd ordItemProd =
       orderServiceProxy.queryOrdOrderItemProdById(itemMeta.getOrderItemId());
   ProdProductBranch prodProductBranch =
       prodProductBranchDAO.selectByPrimaryKey(ordItemProd.getProdBranchId());
   ProdProduct product = prodProductService.getProdProduct(prodProductBranch.getProductId());
   return product.getProductName();
 }