Commit 787b29c2 authored by smestry's avatar smestry

W15FSUN008, Updated class file Palletization confirm.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98918 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 21c1e1b8
...@@ -40,11 +40,14 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo ...@@ -40,11 +40,14 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
public String postSave( String domString, String tranId, String editFlag, String xtraParams, Connection conn ) throws RemoteException, ITMException public String postSave( String domString, String tranId, String editFlag, String xtraParams, Connection conn ) throws RemoteException, ITMException
{ {
InvAllocTraceBean invAllocTrace = new InvAllocTraceBean(); InvAllocTraceBean invAllocTrace = new InvAllocTraceBean();
String errString = "", siteCode = "",lineNo = "", locCode = "", itemCode = "", lotNo = "", lotSl = "", quantity = ""; String errString = "", siteCode = "",lineNo = "", locCode = "", itemCode = "", lotNo = "", lotSl = "", quantity = "", objName = "",
updateFlag = "";
double parseQuantity = 0; double parseQuantity = 0;
HashMap strAllocate = new HashMap(); HashMap strAllocate = new HashMap();
Connection conn1 = null; Connection conn1 = null;
boolean isError = false; boolean isError = false;
boolean isDelete = false;
try try
{ {
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
...@@ -61,7 +64,7 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo ...@@ -61,7 +64,7 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
java.util.Date currDate1 = new java.util.Date(); java.util.Date currDate1 = new java.util.Date();
SimpleDateFormat sdf = new SimpleDateFormat(applDateFormat); SimpleDateFormat sdf = new SimpleDateFormat(applDateFormat);
String currDateStr = sdf.format(currDate1); String currDateStr = sdf.format(currDate1);
java.sql.Timestamp tranDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString( currDateStr , applDateFormat, dbDateFormat ) + " 00:00:00.0") ; Timestamp tranDate = Timestamp.valueOf(genericUtility.getValidDateString( currDateStr , applDateFormat, dbDateFormat ) + " 00:00:00.0");
System.out.println("Calling Post Save for Palletization ::::::::::::: " ); System.out.println("Calling Post Save for Palletization ::::::::::::: " );
System.out.println("domString ::::::::::::: " + domString); System.out.println("domString ::::::::::::: " + domString);
...@@ -69,74 +72,73 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo ...@@ -69,74 +72,73 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
System.out.println("tranId ::::::::::::: " + tranId); System.out.println("tranId ::::::::::::: " + tranId);
lineNo = checkNullAndTrim(genericUtility.getColumnValue("line_no", dom, "3" )); lineNo = checkNullAndTrim(genericUtility.getColumnValue("line_no", dom, "3" ));
lineNo = checkNullAndTrim(genericUtility.getColumnValue("line_no", dom, "3" ));
if( tranId != null && tranId.trim().length() > 0 && lineNo != null && lineNo.trim().length() > 0)
//objName = getObjNameFromDom(dom, "updateFlag", "3");
updateFlag = getUpdateFlagFromDom(dom, "3");
System.out.println("updateFlag--------->>["+updateFlag+"]");
if(!"E".equalsIgnoreCase(updateFlag))
{ {
System.out.println("Inside if for post save palletization ::::::::: " );
siteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" ));
itemCode = checkNull(genericUtility.getColumnValue("item_code", dom, "3" ));
locCode = checkNull(genericUtility.getColumnValue("loc_code", dom, "3" ));
lotNo = checkNull(genericUtility.getColumnValue("lot_no", dom, "3" ));
lotSl = checkNull(genericUtility.getColumnValue("lot_sl", dom, "3" ));
quantity = checkNull(genericUtility.getColumnValue("quantity", dom, "3" ));
parseQuantity = Double.parseDouble(quantity);
System.out.println("lineNo----------->>["+lineNo+"]");
System.out.println("siteCode----------->>["+siteCode+"]");
System.out.println("itemCode----------->>["+itemCode+"]");
System.out.println("locCode----------->>["+locCode+"]");
System.out.println("lotNo----------->>["+lotNo+"]");
System.out.println("lotSl----------->>["+lotSl+"]");
NodeList detail3List = dom.getElementsByTagName("attribute"); if( tranId != null && tranId.trim().length() > 0 && lineNo != null && lineNo.trim().length() > 0)
String test = "";
boolean isDelete = false;
for(int ctr = 0;ctr < detail3List.getLength() ; ctr++)
{ {
Node detail3Node = detail3List.item(ctr); System.out.println("Inside if for post save palletization ::::::::: " );
siteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" ));
itemCode = checkNull(genericUtility.getColumnValue("item_code", dom, "3" ));
locCode = checkNull(genericUtility.getColumnValue("loc_code", dom, "3" ));
lotNo = checkNull(genericUtility.getColumnValue("lot_no", dom, "3" ));
lotSl = checkNull(genericUtility.getColumnValue("lot_sl", dom, "3" ));
quantity = checkNull(genericUtility.getColumnValue("quantity", dom, "3" ));
parseQuantity = Double.parseDouble(quantity);
test = detail3Node.getAttributes().getNamedItem("updateFlag").getNodeValue(); System.out.println("lineNo----------->>["+lineNo+"]");
System.out.println("test----------->>["+test+"]"); System.out.println("siteCode----------->>["+siteCode+"]");
if("D".equalsIgnoreCase(test)) System.out.println("itemCode----------->>["+itemCode+"]");
System.out.println("locCode----------->>["+locCode+"]");
System.out.println("lotNo----------->>["+lotNo+"]");
System.out.println("lotSl----------->>["+lotSl+"]");
if("D".equalsIgnoreCase(updateFlag))
{ {
isDelete = true; isDelete = true;
} }
//System.out.println("isDelete----------->>["+isDelete+"]");
strAllocate.put("tran_date", tranDate);
strAllocate.put("ref_ser","PZ");
strAllocate.put("ref_id", tranId);
strAllocate.put("ref_line", lineNo);
strAllocate.put("site_code", siteCode);
strAllocate.put("item_code", itemCode);
strAllocate.put("loc_code", locCode);
strAllocate.put("lot_no", lotNo);
strAllocate.put("lot_sl", lotSl);
if(isDelete)
{
strAllocate.put("alloc_qty", -parseQuantity);
}
else
{
strAllocate.put("alloc_qty", parseQuantity);
}
strAllocate.put("chg_user", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"loginCode"));
strAllocate.put("chg_term", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"termId"));
strAllocate.put("chg_win", "W_PALLETIZATION");
errString = invAllocTrace.updateInvallocTrace(strAllocate, conn1);
System.out.println("errString ::: " + errString);
if (errString != null && errString.trim().length() > 0 )
{
isError = true;
return errString;
}
strAllocate = null;
System.out.println("Allocated the quantity in stock::::::::::: ");
} }
System.out.println("isDelete----------->>["+isDelete+"]");
strAllocate.put("tran_date", tranDate);
strAllocate.put("ref_ser","PZ");
strAllocate.put("ref_id", tranId);
strAllocate.put("ref_line", lineNo);
strAllocate.put("site_code", siteCode);
strAllocate.put("item_code", itemCode);
strAllocate.put("loc_code", locCode);
strAllocate.put("lot_no", lotNo);
strAllocate.put("lot_sl", lotSl);
if(isDelete)
{
strAllocate.put("alloc_qty", -parseQuantity) ;
}
else
{
strAllocate.put("alloc_qty", parseQuantity) ;
}
strAllocate.put("chg_user", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"loginCode"));
strAllocate.put("chg_term", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"termId"));
strAllocate.put("chg_win", "W_PALLETIZATION");
errString = invAllocTrace.updateInvallocTrace(strAllocate, conn1);
System.out.println("errString ::: " + errString);
if (errString != null && errString.trim().length() > 0 )
{
isError = true;
return errString;
}
strAllocate = null;
System.out.println("Allocated the quantity in stock::::::::::: ");
} }
} }
catch(Exception e) catch(Exception e)
...@@ -161,7 +163,7 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo ...@@ -161,7 +163,7 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
if( !isError ) if( !isError )
{ {
System.out.println("commmit"); System.out.println("commmit");
conn1.commit(); conn1.commit();
} }
else if ( isError ) else if ( isError )
{ {
...@@ -204,6 +206,57 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo ...@@ -204,6 +206,57 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
} }
return inputVal; return inputVal;
} }
//private String getObjNameFromDom( Document dom, String attribute, String objContext ) throws RemoteException,ITMException
private String getUpdateFlagFromDom( Document dom, String objContext ) throws RemoteException,ITMException
{
NodeList detailList = null;
Node attrbNode = null, detailNode = null, reqDetail = null;
String retString = "";
int detailListLength = 0;
try
{
detailList = dom.getElementsByTagName("Detail"+objContext);
detailListLength = detailList.getLength();
for (int ctr = 0; ctr < detailListLength; ctr++)
{
detailNode = detailList.item(ctr);
System.out.println("detail node::::::::::: ");
if(detailNode != null)
{
System.out.println("detail node::::::::::: "+detailNode.getNodeName());
NodeList attrbNodeList = detailNode.getChildNodes();
for (int ctrA = 0; ctrA < attrbNodeList.getLength(); ctrA++)
{
attrbNode = attrbNodeList.item(ctrA);
if(attrbNode != null)
{
if( attrbNode.getNodeType() != Node.ELEMENT_NODE )
{
continue;
}
System.out.println("attrbNode node::::::::::: "+attrbNode.getNodeName());
if(attrbNode != null && "attribute".equalsIgnoreCase(attrbNode.getNodeName()))
{
System.out.println("attrbNode node::::::::::: ");
retString = attrbNode.getAttributes().getNamedItem("updateFlag").getNodeValue();
//return retString;
}
}
}
}
//test = detail3Node.getAttributes().getNamedItem("updateFlag").getNodeValue();
}
}
catch ( Exception e )
{
throw new ITMException(e);
}
return retString;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment