Added service to take Set of orderIds that are no longer on backorder and call the oagisSendProcessShipment message for each; uses new Set returned by balanceInventoryItems service; as per normal the SECAs are commented out so that none of this runs by default
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@569963 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -27,15 +27,13 @@ under the License.
|
||||
<condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/>
|
||||
<action service="oagisSendProcessShipment" mode="async" persist="true"/>
|
||||
</eca>
|
||||
<eca service="balanceInventoryItems" event="commit">
|
||||
<condition field-name="noLongerOnBackOrderIdSet" operator="is-not-empty"/>
|
||||
<action service="oagisSendProcessShipmentsFromBackOrderSet" mode="async"/>
|
||||
</eca>
|
||||
<eca service="updateReturnHeader" event="commit">
|
||||
<condition field-name="statusId" operator="equals" value="RETURN_ACCEPTED"/>
|
||||
<action service="oagisSendReceiveDelivery" mode="async" persist="true"/>
|
||||
</eca>
|
||||
-->
|
||||
|
||||
<!-- causing double calls to oagisSendProcessShipment for non-backorder scenarios
|
||||
<eca service="reserveProductInventoryByFacility" event="global-commit">
|
||||
<action service="oagisSendProcessShipment" mode="async" persist="true"/>
|
||||
</eca>
|
||||
-->
|
||||
</service-eca>
|
||||
|
||||
@@ -105,6 +105,10 @@ under the License.
|
||||
<attribute name="outputStream" type="java.io.OutputStream" mode="IN" optional="true"/>
|
||||
<attribute name="orderId" mode="IN" type="String" optional="false"/>
|
||||
</service>
|
||||
<service name="oagisSendProcessShipmentsFromBackOrderSet" engine="java"
|
||||
location="org.ofbiz.oagis.OagisShipmentServices" invoke="oagisSendProcessShipmentsFromBackOrderSet">
|
||||
<attribute name="noLongerOnBackOrderIdSet" type="Set" mode="IN" optional="false"/>
|
||||
</service>
|
||||
|
||||
<service name="oagisSendReceiveDelivery" max-retry="0" engine="java"
|
||||
location="org.ofbiz.oagis.OagisShipmentServices" invoke="oagisSendReceiveDelivery">
|
||||
|
||||
@@ -75,7 +75,7 @@ public class OagisInventoryServices {
|
||||
GenericValue userLogin = null;
|
||||
try {
|
||||
userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system"));
|
||||
} catch (GenericEntityException e){
|
||||
} catch (GenericEntityException e) {
|
||||
String errMsg = "Error Getting UserLogin: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -307,7 +307,7 @@ public class OagisInventoryServices {
|
||||
try {
|
||||
comiCtx.put("processingStatusId", "OAGMP_PROC_ERROR");
|
||||
dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -322,7 +322,7 @@ public class OagisInventoryServices {
|
||||
saveErrorMapListCtx.put("userLogin", userLogin);
|
||||
try {
|
||||
dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -335,7 +335,7 @@ public class OagisInventoryServices {
|
||||
|
||||
// run async because this will send a message back to the other server and may take some time, and/or fail
|
||||
dispatcher.runAsync("oagisSendConfirmBod", sendConfirmBodCtx, null, true, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error sending Confirm BOD: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -347,7 +347,7 @@ public class OagisInventoryServices {
|
||||
try {
|
||||
comiCtx.put("processingStatusId", "OAGMP_PROC_SUCCESS");
|
||||
dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
// don't pass this back, nothing they can do about it: errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException"));
|
||||
Debug.logError(e, errMsg, module);
|
||||
@@ -557,7 +557,7 @@ public class OagisInventoryServices {
|
||||
try {
|
||||
comiCtx.put("processingStatusId", "OAGMP_PROC_ERROR");
|
||||
dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -572,7 +572,7 @@ public class OagisInventoryServices {
|
||||
saveErrorMapListCtx.put("userLogin", userLogin);
|
||||
try {
|
||||
dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -585,7 +585,7 @@ public class OagisInventoryServices {
|
||||
|
||||
// run async because this will send a message back to the other server and may take some time, and/or fail
|
||||
dispatcher.runAsync("oagisSendConfirmBod", sendConfirmBodCtx, null, true, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error sending Confirm BOD: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -597,7 +597,7 @@ public class OagisInventoryServices {
|
||||
comiCtx.put("processingStatusId", "OAGMP_PROC_SUCCESS");
|
||||
try {
|
||||
dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
// don't pass this back, nothing they can do about it: errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException"));
|
||||
Debug.logError(e, errMsg, module);
|
||||
@@ -795,7 +795,7 @@ public class OagisInventoryServices {
|
||||
if (inventoryItem !=null) {
|
||||
productId = inventoryItem.getString("productId");
|
||||
}
|
||||
} catch (GenericEntityException e){
|
||||
} catch (GenericEntityException e) {
|
||||
String errMsg = "Error Getting Entity InventoryItem";
|
||||
Debug.logError(e, errMsg, module);
|
||||
} */
|
||||
@@ -1033,7 +1033,7 @@ public class OagisInventoryServices {
|
||||
try {
|
||||
comiCtx.put("processingStatusId", "OAGMP_PROC_ERROR");
|
||||
dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -1048,7 +1048,7 @@ public class OagisInventoryServices {
|
||||
saveErrorMapListCtx.put("userLogin", userLogin);
|
||||
try {
|
||||
dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -1062,7 +1062,7 @@ public class OagisInventoryServices {
|
||||
|
||||
// run async because this will send a message back to the other server and may take some time, and/or fail
|
||||
dispatcher.runAsync("oagisSendConfirmBod", sendConfirmBodCtx, null, true, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error sending Confirm BOD: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -1074,7 +1074,7 @@ public class OagisInventoryServices {
|
||||
comiCtx.put("processingStatusId", "OAGMP_PROC_SUCCESS");
|
||||
try {
|
||||
dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
// don't pass this back, nothing they can do about it: errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException"));
|
||||
Debug.logError(e, errMsg, module);
|
||||
@@ -1319,7 +1319,7 @@ public class OagisInventoryServices {
|
||||
try {
|
||||
comiCtx.put("processingStatusId", "OAGMP_PROC_ERROR");
|
||||
dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -1334,7 +1334,7 @@ public class OagisInventoryServices {
|
||||
saveErrorMapListCtx.put("userLogin", userLogin);
|
||||
try {
|
||||
dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -1345,7 +1345,7 @@ public class OagisInventoryServices {
|
||||
|
||||
// run async because this will send a message back to the other server and may take some time, and/or fail
|
||||
dispatcher.runAsync("oagisSendConfirmBod", sendConfirmBodCtx, null, true, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error sending Confirm BOD: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -1357,7 +1357,7 @@ public class OagisInventoryServices {
|
||||
comiCtx.put("processingStatusId", "OAGMP_PROC_SUCCESS");
|
||||
try {
|
||||
dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
// don't pass this back, nothing they can do about it: errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException"));
|
||||
Debug.logError(e, errMsg, module);
|
||||
|
||||
@@ -198,7 +198,7 @@ public class OagisServices {
|
||||
}
|
||||
try {
|
||||
dispatcher.runSync("updateOagisMessageInfo", oagisMsgInfoContext, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = UtilProperties.getMessage(ServiceUtil.resource, "OagisErrorInCreatingDataForOagisMessageInfoEntity", (Locale) context.get("locale"));
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -212,7 +212,7 @@ public class OagisServices {
|
||||
oagisMsgInfoContext.put("processingStatusId", "OAGMP_SENT");
|
||||
try {
|
||||
dispatcher.runSync("updateOagisMessageInfo", oagisMsgInfoContext, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = UtilProperties.getMessage(ServiceUtil.resource, "OagisErrorInCreatingDataForOagisMessageInfoEntity", (Locale) context.get("locale"));
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -229,7 +229,7 @@ public class OagisServices {
|
||||
GenericValue userLogin = null;
|
||||
try {
|
||||
userLogin = delegator.findByPrimaryKey("UserLogin",UtilMisc.toMap("userLoginId", "system"));
|
||||
} catch (GenericEntityException e){
|
||||
} catch (GenericEntityException e) {
|
||||
String errMsg = "Error Getting UserLogin with userLoginId 'system':" + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -298,7 +298,7 @@ public class OagisServices {
|
||||
try {
|
||||
dispatcher.runSync("createOagisMessageInfo", oagisMsgInfoCtx, 60, true);
|
||||
/* running async for better error handling
|
||||
if (ServiceUtil.isError(oagisMsgInfoResult)){
|
||||
if (ServiceUtil.isError(oagisMsgInfoResult)) {
|
||||
String errMsg = "Error creating OagisMessageInfo for the Incoming Message: "+ServiceUtil.getErrorMessage(oagisMsgInfoResult);
|
||||
errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "CreateOagisMessageInfoServiceError"));
|
||||
Debug.logError(errMsg, module);
|
||||
@@ -328,7 +328,7 @@ public class OagisServices {
|
||||
createOagisMessageErrorInfoForOriginal.put("description", description);
|
||||
|
||||
Map oagisMsgErrorInfoResult = dispatcher.runSync("createOagisMessageErrorInfo", createOagisMessageErrorInfoForOriginal);
|
||||
if (ServiceUtil.isError(oagisMsgErrorInfoResult)){
|
||||
if (ServiceUtil.isError(oagisMsgErrorInfoResult)) {
|
||||
String errMsg = "Error creating OagisMessageErrorInfo: " + ServiceUtil.getErrorMessage(oagisMsgErrorInfoResult);
|
||||
errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "CreateOagisMessageErrorInfoServiceError"));
|
||||
Debug.logError(errMsg, module);
|
||||
@@ -360,7 +360,7 @@ public class OagisServices {
|
||||
|
||||
// this one will also go in another transaction as the create service for the base record did too
|
||||
Map oagisMsgErrorInfoResult = dispatcher.runSync("createOagisMessageErrorInfo", createOagisMessageErrorInfoForCbod, 60, true);
|
||||
if (ServiceUtil.isError(oagisMsgErrorInfoResult)){
|
||||
if (ServiceUtil.isError(oagisMsgErrorInfoResult)) {
|
||||
String errMsg = "Error creating OagisMessageErrorInfo: " + ServiceUtil.getErrorMessage(oagisMsgErrorInfoResult);
|
||||
Debug.logError(errMsg, module);
|
||||
}
|
||||
@@ -389,7 +389,7 @@ public class OagisServices {
|
||||
saveErrorMapListCtx.put("userLogin", userLogin);
|
||||
try {
|
||||
dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -403,7 +403,7 @@ public class OagisServices {
|
||||
|
||||
// run async because this will send a message back to the other server and may take some time, and/or fail
|
||||
dispatcher.runAsync("oagisSendConfirmBod", sendConfirmBodCtx, null, true, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -415,7 +415,7 @@ public class OagisServices {
|
||||
oagisMsgInfoCtx.put("processingStatusId", "OAGMP_PROC_SUCCESS");
|
||||
try {
|
||||
dispatcher.runSync("updateOagisMessageInfo", oagisMsgInfoCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
// don't pass this back, nothing they can do about it: errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException"));
|
||||
Debug.logError(e, errMsg, module);
|
||||
@@ -435,7 +435,7 @@ public class OagisServices {
|
||||
GenericValue userLogin = null;
|
||||
try {
|
||||
userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system"));
|
||||
} catch (GenericEntityException e){
|
||||
} catch (GenericEntityException e) {
|
||||
String errMsg = "Error Getting UserLogin with userLoginId system: "+e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -526,7 +526,7 @@ public class OagisServices {
|
||||
try {
|
||||
// run async because this will send a message back to the other server and may take some time, and/or fail
|
||||
dispatcher.runAsync("oagisSendConfirmBod", sendConfirmBodCtx, null, true, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error sending Confirm BOD: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,9 @@ import org.ofbiz.product.product.ProductWorker;
|
||||
import org.ofbiz.service.DispatchContext;
|
||||
import org.ofbiz.service.GenericServiceException;
|
||||
import org.ofbiz.service.LocalDispatcher;
|
||||
import org.ofbiz.service.ServiceAuthException;
|
||||
import org.ofbiz.service.ServiceUtil;
|
||||
import org.ofbiz.service.ServiceValidationException;
|
||||
import org.ofbiz.widget.fo.FoFormRenderer;
|
||||
import org.ofbiz.widget.html.HtmlScreenRenderer;
|
||||
import org.ofbiz.widget.screen.ScreenRenderer;
|
||||
@@ -94,7 +96,7 @@ public class OagisShipmentServices {
|
||||
GenericValue userLogin = null;
|
||||
try {
|
||||
userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system"));
|
||||
} catch (GenericEntityException e){
|
||||
} catch (GenericEntityException e) {
|
||||
String errMsg = "Error Getting UserLogin with userLoginId system: "+e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -154,13 +156,13 @@ public class OagisShipmentServices {
|
||||
dispatcher.runSync("createOagisMessageInfo", oagisMsgInfoCtx, 60, true);
|
||||
}
|
||||
/* running async for better error handling
|
||||
if (ServiceUtil.isError(oagisMsgInfoResult)){
|
||||
if (ServiceUtil.isError(oagisMsgInfoResult)) {
|
||||
String errMsg = ServiceUtil.getErrorMessage(oagisMsgInfoResult);
|
||||
// errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "CreateOagisMessageInfoServiceError"));
|
||||
Debug.logError(errMsg, module);
|
||||
}
|
||||
*/
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error creating OagisMessageInfo for the Incoming Message: "+e.toString();
|
||||
// don't pass this back, nothing they can do about it: errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException"));
|
||||
Debug.logError(e, errMsg, module);
|
||||
@@ -189,7 +191,7 @@ public class OagisShipmentServices {
|
||||
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)){
|
||||
if (UtilValidate.isNotEmpty(carrierCode)) {
|
||||
String carrierPartyId = null;
|
||||
if ( carrierCode.startsWith("F") || carrierCode.startsWith("f")) {
|
||||
carrierPartyId = "FEDEX";
|
||||
@@ -197,7 +199,7 @@ public class OagisShipmentServices {
|
||||
carrierPartyId = "UPS";
|
||||
}
|
||||
Map resultMap = dispatcher.runSync("updateShipmentRouteSegment", UtilMisc.toMap("shipmentId", shipmentId, "shipmentRouteSegmentId", "00001", "carrierPartyId", carrierPartyId, "trackingIdNumber", trackingNum, "userLogin", userLogin));
|
||||
if (ServiceUtil.isError(resultMap)){
|
||||
if (ServiceUtil.isError(resultMap)) {
|
||||
String errMsg = ServiceUtil.getErrorMessage(resultMap);
|
||||
errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "updateShipmentRouteSegmentError"));
|
||||
Debug.logError(errMsg, module);
|
||||
@@ -444,7 +446,7 @@ public class OagisShipmentServices {
|
||||
isitspastCtx.put("inventoryItemId", orderItemShipGrpInvReservation.get("inventoryItemId"));
|
||||
isitspastCtx.remove("itemIssuanceId");
|
||||
Map resultMap = dispatcher.runSync("issueSerializedInvToShipmentPackageAndSetTracking", isitspastCtx);
|
||||
if (ServiceUtil.isError(resultMap)){
|
||||
if (ServiceUtil.isError(resultMap)) {
|
||||
String errMsg = ServiceUtil.getErrorMessage(resultMap);
|
||||
errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "IssueSerializedInvServiceError"));
|
||||
Debug.logError(errMsg, module);
|
||||
@@ -454,7 +456,7 @@ public class OagisShipmentServices {
|
||||
isitspastCtx.put("quantity", new Double(quantityToUse));
|
||||
// NOTE: this same service is called for non-serialized inventory in spite of the name it is made to handle it
|
||||
Map resultMap = dispatcher.runSync("issueSerializedInvToShipmentPackageAndSetTracking", isitspastCtx);
|
||||
if (ServiceUtil.isError(resultMap)){
|
||||
if (ServiceUtil.isError(resultMap)) {
|
||||
String errMsg = ServiceUtil.getErrorMessage(resultMap);
|
||||
errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "IssueSerializedInvServiceError"));
|
||||
Debug.logError(errMsg, module);
|
||||
@@ -468,7 +470,7 @@ public class OagisShipmentServices {
|
||||
|
||||
if (errorMapList.size() == 0) {
|
||||
Map resultMap = dispatcher.runSync("setShipmentStatusPackedAndShipped", UtilMisc.toMap("shipmentId", shipmentId, "userLogin", userLogin));
|
||||
if (ServiceUtil.isError(resultMap)){
|
||||
if (ServiceUtil.isError(resultMap)) {
|
||||
String errMsg = ServiceUtil.getErrorMessage(resultMap);
|
||||
errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "SetShipmentStatusPackedAndShippedError"));
|
||||
Debug.logError(errMsg, module);
|
||||
@@ -496,7 +498,7 @@ public class OagisShipmentServices {
|
||||
try {
|
||||
oagisMsgInfoCtx.put("processingStatusId", "OAGMP_PROC_ERROR");
|
||||
dispatcher.runSync("updateOagisMessageInfo", oagisMsgInfoCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -511,7 +513,7 @@ public class OagisShipmentServices {
|
||||
saveErrorMapListCtx.put("userLogin", userLogin);
|
||||
try {
|
||||
dispatcher.runSync("createOagisMsgErrInfosFromErrMapList", saveErrorMapListCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -524,7 +526,7 @@ public class OagisShipmentServices {
|
||||
|
||||
// run async because this will send a message back to the other server and may take some time, and/or fail
|
||||
dispatcher.runAsync("oagisSendConfirmBod", sendConfirmBodCtx, null, true, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error sending Confirm BOD: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -537,7 +539,7 @@ public class OagisShipmentServices {
|
||||
try {
|
||||
oagisMsgInfoCtx.put("processingStatusId", "OAGMP_PROC_SUCCESS");
|
||||
dispatcher.runSync("updateOagisMessageInfo", oagisMsgInfoCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error updating OagisMessageInfo for the Incoming Message: " + e.toString();
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -546,6 +548,28 @@ public class OagisShipmentServices {
|
||||
result.putAll(ServiceUtil.returnSuccess("Service Completed Successfully"));
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Map oagisSendProcessShipmentsFromBackOrderSet(DispatchContext ctx, Map context) {
|
||||
LocalDispatcher dispatcher = ctx.getDispatcher();
|
||||
|
||||
Set noLongerOnBackOrderIdSet = (Set) context.get("noLongerOnBackOrderIdSet");
|
||||
if (UtilValidate.isEmpty(noLongerOnBackOrderIdSet)) {
|
||||
return ServiceUtil.returnSuccess();
|
||||
}
|
||||
|
||||
try {
|
||||
Iterator noLongerOnBackOrderIdIter = noLongerOnBackOrderIdSet.iterator();
|
||||
while (noLongerOnBackOrderIdIter.hasNext()) {
|
||||
String orderId = (String) noLongerOnBackOrderIdIter.next();
|
||||
dispatcher.runAsync("oagisSendProcessShipment", UtilMisc.toMap("orderId", orderId), true);
|
||||
}
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = "Error calling oagisSendProcessShipment service for orders with items no longer on backorder: " + e.toString();
|
||||
return ServiceUtil.returnError(errMsg);
|
||||
}
|
||||
|
||||
return ServiceUtil.returnSuccess();
|
||||
}
|
||||
|
||||
public static Map oagisSendProcessShipment(DispatchContext ctx, Map context) {
|
||||
LocalDispatcher dispatcher = ctx.getDispatcher();
|
||||
@@ -672,7 +696,7 @@ public class OagisShipmentServices {
|
||||
comiCtx.put("userLogin", userLogin);
|
||||
try {
|
||||
dispatcher.runSync("createOagisMessageInfo", comiCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = UtilProperties.getMessage(ServiceUtil.resource, "OagisErrorInCreatingDataForOagisMessageInfoEntity", (Locale) context.get("locale"));
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -817,7 +841,7 @@ public class OagisShipmentServices {
|
||||
comiCtx.put("fullMessageXml", outText);
|
||||
}
|
||||
dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = UtilProperties.getMessage(ServiceUtil.resource, "OagisErrorInCreatingDataForOagisMessageInfoEntity", (Locale) context.get("locale"));
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
@@ -828,7 +852,7 @@ public class OagisShipmentServices {
|
||||
try {
|
||||
comiCtx.put("processingStatusId", "OAGMP_SENT");
|
||||
dispatcher.runSync("updateOagisMessageInfo", comiCtx, 60, true);
|
||||
} catch (GenericServiceException e){
|
||||
} catch (GenericServiceException e) {
|
||||
String errMsg = UtilProperties.getMessage(ServiceUtil.resource, "OagisErrorInCreatingDataForOagisMessageInfoEntity", (Locale) context.get("locale"));
|
||||
Debug.logError(e, errMsg, module);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user