Пример #1
0
  public void processTransaction() throws Exception {
    InboundTranslate translator = getTranslator();
    TradingProfileData profile = translator.getProfile();
    int[] busEntIds =
        translator.getTradingPartnerBusEntityIds(
            profile.getTradingPartnerId(), RefCodeNames.TRADING_PARTNER_ASSOC_CD.DISTRIBUTOR);
    String busEntId;
    if (busEntIds.length > 0) {
      busEntId = Integer.toString(busEntIds[0]);
    } else {
      busEntId = "UNKNOWN";
    }
    OrderData orderD = null;
    boolean matchByVendorOrderNum =
        ediInp856Vw.getMatchPoNumType().equals(RefCodeNames.MATCH_PO_NUM_TYPE_CD.VENDOR_ORDER_NUM);
    String poNum =
        matchByVendorOrderNum ? ediInp856Vw.getDistOrderNum() : ediInp856Vw.getPurchOrderNum();
    orderD =
        getTranslator().getOrderDataByPoNum(poNum, null, null, ediInp856Vw.getMatchPoNumType());

    if (orderD == null) {
      // String errorMess = "No purchase order found with po num: " + purchOrderNum;
      // errorMsgs.add(errorMess);
      // setValid(false);
    } else {
      getTransactionD().setOrderId(orderD.getOrderId());
      ediInp856Vw.setOrderId(orderD.getOrderId());
    }
    getTransactionD()
        .setKeyString(
            "ErpPoNum: "
                + ediInp856Vw.getPurchOrderNum()
                + " DistPoNum: "
                + ediInp856Vw.getDistOrderNum()
                + ", Distr Id: "
                + busEntId);

    // Pulling out ICN and GCN: Begin
    int ICN = ediHandler.getProfile().getInterchangeControlNum();
    int GCN = ediHandler.getProfile().getGroupControlNum();
    ediInp856Vw.setInterchangeControlNum(ICN);
    ediInp856Vw.setGroupControlNum(GCN);
    log.info("ICN = " + ICN);
    log.info("GCN = " + GCN);
    // Pulling out ICN and GCN: End

    ediHandler.appendIntegrationRequest(ediInp856Vw);
  }
Пример #2
0
 public void extractPurchaseOrderReferencePRF(Loop inLoop) throws OBOEException {
   Segment segment = null;
   try {
     segment = inLoop.getSegment("PRF");
   } catch (Exception exc) {
   }
   if (segment == null) {
     return;
   }
   String purchaseOrderNumber = getField(segment, 1, false, null);
   if (Utility.isSet(ediInp856Vw.getDistOrderNum())
       && !ediInp856Vw.getDistOrderNum().equals(purchaseOrderNumber)) {
     ediHandler.appendIntegrationRequest(ediInp856Vw);
     ediInp856Vw = ediInp856Vw.copy();
     ediInp856Vw.setItems(new EdiInp856ItemViewVector());
   }
   ediInp856Vw.setDistOrderNum(purchaseOrderNumber);
   return;
 }