Author: apatel
Date: Mon Aug 6 18:53:46 2007 New Revision: 563368 URL: http://svn.apache.org/viewvc?view=rev&rev=563368 Log: Storing carrierPartyId in ShipmentRouteSegment Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java?view=diff&rev=563368&r1=563367&r2=563368 ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original) +++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Mon Aug 6 18:53:46 2007 @@ -191,10 +191,33 @@ List shipUnitElementList = UtilXml.childElementList(daShowShipmentElement, "ns:SHIPUNIT"); // n if(UtilValidate.isNotEmpty(shipUnitElementList)) { + Element shipUnitElement = (Element)shipUnitElementList.get(0); + String trackingNum = UtilXml.childElementValue(shipUnitElement, "of:TRACKINGID"); // of + String carrierCode = UtilXml.childElementValue(shipUnitElement, "of:CARRIER"); // of + if(UtilValidate.isNotEmpty(carrierCode)){ + String carrierPartyId = null; + if( carrierCode.startsWith("F")) { + carrierPartyId = "FEDEX"; + } else if(carrierCode.startsWith("U")) { + carrierPartyId = "UPS"; + } + try { + Map resultMap = dispatcher.runSync("updateShipmentRouteSegment", UtilMisc.toMap("shipmentId", shipmentId, "shipmentRouteSegmentId", "00001", "carrierPatyId", carrierPartyId, "trackingIdNumber", trackingNum, "userLogin", userLogin)); + if (ServiceUtil.isError(resultMap)){ + String errMsg = ServiceUtil.getErrorMessage(resultMap); + errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "updateShipmentRouteSegmentError")); + Debug.logError(errMsg, module); + } + }catch (GenericServiceException e) { + Debug.logInfo(e, module); + String errMsg = "Error executing updateShipmentRouteSegment Service: "+e.toString(); + errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException")); + } + } + Iterator shipUnitElementItr = shipUnitElementList.iterator(); while(shipUnitElementItr.hasNext()) { - Element shipUnitElement = (Element) shipUnitElementItr.next(); - String trackingNum = UtilXml.childElementValue(shipUnitElement, "of:TRACKINGID"); // of + shipUnitElement = (Element) shipUnitElementItr.next(); String shipmentPackageSeqId = UtilXml.childElementValue(shipUnitElement, "of:SHPUNITSEQ"); // of List invItemElementList = UtilXml.childElementList(shipUnitElement, "ns:INVITEM"); //n if(UtilValidate.isNotEmpty(invItemElementList)) { |
Free forum by Nabble | Edit this page |