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
public String postSave( String domString, String tranId, String editFlag, String xtraParams, Connection conn ) throws RemoteException, ITMException
{
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;
HashMap strAllocate = new HashMap();
Connection conn1 = null;
boolean isError = false;
boolean isDelete = false;
try
{
ConnDriver connDriver = new ConnDriver();
......@@ -61,7 +64,7 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
java.util.Date currDate1 = new java.util.Date();
SimpleDateFormat sdf = new SimpleDateFormat(applDateFormat);
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("domString ::::::::::::: " + domString);
......@@ -69,6 +72,14 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
System.out.println("tranId ::::::::::::: " + tranId);
lineNo = checkNullAndTrim(genericUtility.getColumnValue("line_no", dom, "3" ));
lineNo = checkNullAndTrim(genericUtility.getColumnValue("line_no", dom, "3" ));
//objName = getObjNameFromDom(dom, "updateFlag", "3");
updateFlag = getUpdateFlagFromDom(dom, "3");
System.out.println("updateFlag--------->>["+updateFlag+"]");
if(!"E".equalsIgnoreCase(updateFlag))
{
if( tranId != null && tranId.trim().length() > 0 && lineNo != null && lineNo.trim().length() > 0)
{
......@@ -89,23 +100,11 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
System.out.println("lotNo----------->>["+lotNo+"]");
System.out.println("lotSl----------->>["+lotSl+"]");
NodeList detail3List = dom.getElementsByTagName("attribute");
String test = "";
boolean isDelete = false;
for(int ctr = 0;ctr < detail3List.getLength() ; ctr++)
{
Node detail3Node = detail3List.item(ctr);
test = detail3Node.getAttributes().getNamedItem("updateFlag").getNodeValue();
System.out.println("test----------->>["+test+"]");
if("D".equalsIgnoreCase(test))
if("D".equalsIgnoreCase(updateFlag))
{
isDelete = true;
}
}
System.out.println("isDelete----------->>["+isDelete+"]");
//System.out.println("isDelete----------->>["+isDelete+"]");
strAllocate.put("tran_date", tranDate);
strAllocate.put("ref_ser","PZ");
strAllocate.put("ref_id", tranId);
......@@ -115,14 +114,16 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
strAllocate.put("loc_code", locCode);
strAllocate.put("lot_no", lotNo);
strAllocate.put("lot_sl", lotSl);
if(isDelete)
{
strAllocate.put("alloc_qty", -parseQuantity) ;
strAllocate.put("alloc_qty", -parseQuantity);
}
else
{
strAllocate.put("alloc_qty", parseQuantity) ;
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");
......@@ -139,6 +140,7 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
System.out.println("Allocated the quantity in stock::::::::::: ");
}
}
}
catch(Exception e)
{
try
......@@ -204,6 +206,57 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
}
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