Commit d703f428 authored by ssarkar's avatar ssarkar

update by sumit on 08/02/13 bug solved for master pack and unpack


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92662 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e9a57bc4
...@@ -151,7 +151,8 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma ...@@ -151,7 +151,8 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma
double masterPackCount = 0.0, masterPackWeight = 0.0; // Added by sumit on 16/01/13 double masterPackCount = 0.0, masterPackWeight = 0.0; // Added by sumit on 16/01/13
DistCommon discommon = new DistCommon(); // Added by sumit on 16/01/13 DistCommon discommon = new DistCommon(); // Added by sumit on 16/01/13
String lotNo = "";//added by sumit on 08/02/13
Node parentNode = null;//added by sumit on 08/02/13
int currentFormNo = 0, cnt = 0, count = 0; int currentFormNo = 0, cnt = 0, count = 0;
ConnDriver connDriver = null; ConnDriver connDriver = null;
...@@ -686,18 +687,53 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma ...@@ -686,18 +687,53 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
//Changed By Pragyan 21/01/12.end //Changed By Pragyan 21/01/12.end
String currCarton = "", currItemCode = "",currLotNo = "";
currCarton = genericUtility.getColumnValue( "carton_no", currDom );
currItemCode = genericUtility.getColumnValue( "item_code", currDom );
currLotNo = genericUtility.getColumnValue( "lot_no", currDom );
System.out.println(" currCarton["+currCarton+"] currItemCode["+currItemCode+"] currLotNo["+currLotNo+"]");
sqlInner = "select gross_weight,(length*width*height) from item_lot_packsize where item_code = ? " +
" and lot_no__from <= ? and lot_no__to >= ? ";
pstmtInner = conn.prepareStatement( sqlInner );
pstmtInner.setString( 1,currItemCode );
pstmtInner.setString( 2,currLotNo );
pstmtInner.setString( 3,currLotNo );
rsInner = pstmtInner.executeQuery();
if( rsInner.next() )
{
weight += rsInner.getDouble("gross_weight");
selectCartVolume += rsInner.getDouble(2);
}
rsInner.close();
rsInner = null;
pstmtInner.close();
pstmtInner = null;
parentList = allDom.getElementsByTagName( "Detail" + currentFormNo ); parentList = allDom.getElementsByTagName( "Detail" + currentFormNo );
int noOfParent = parentList.getLength(); int noOfParent = parentList.getLength();
System.out.println("no of parent="+noOfParent); System.out.println("no of parent="+noOfParent);
for ( int ctr1 = 0; ctr1 < noOfParent; ctr1++ ) for ( int ctr1 = 0; ctr1 < noOfParent; ctr1++ )
{ {
//Changed by sumit on 08/02/13 only selected record allow start
parentNode = parentList.item(ctr1);
String selected = getAttribValue(parentNode, "attribute", "selected");
System.out.println(" value of selected variable ["+selected+"]");
if(!"Y".equalsIgnoreCase(selected))
{
continue;
}
//Changed by sumit on 08/02/13 only selected record allow end
innerCarton = genericUtility.getColumnValueFromNode( "carton_no", parentList.item(ctr1) ); innerCarton = genericUtility.getColumnValueFromNode( "carton_no", parentList.item(ctr1) );
itemCode = genericUtility.getColumnValueFromNode( "item_code", parentList.item(ctr1) ); itemCode = genericUtility.getColumnValueFromNode( "item_code", parentList.item(ctr1) );
//Changed by sumit on 08/02/13 getting lot_no value
lotNo = genericUtility.getColumnValueFromNode( "lot_no", parentList.item(ctr1) );
ptcn = genericUtility.getColumnValue("ptcn", hdrDom ); ptcn = genericUtility.getColumnValue("ptcn", hdrDom );
System.out.println("carton no == "+innerCarton); System.out.println("carton no == "+innerCarton);
System.out.println("item code == "+itemCode); System.out.println("item code == ["+itemCode+"] lot_no ["+lotNo+"]");
System.out.println("ptcn== "+ptcn); System.out.println("ptcn== "+ptcn);
if( innerCarton == null || innerCarton.trim().length() == 0 ) if( innerCarton == null || innerCarton.trim().length() == 0 )
...@@ -728,39 +764,51 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma ...@@ -728,39 +764,51 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma
errList.add( "VTCARTNO4" ); errList.add( "VTCARTNO4" );
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
//Changed by sumit on 08/02/13 below code will execute in else as Manoharan Sir.
System.out.println("item Code="+itemCode+" weight ="+weight+" no of item"+noCases); else
noCases++;
//sqlInner = "select gross_weight from item_lot_packsize where item_code = ? ";
sqlInner = "select gross_weight,(length*width*height) from item_lot_packsize where item_code = ? ";
pstmtInner = conn.prepareStatement( sqlInner );
pstmtInner.setString( 1,itemCode );
rsInner = pstmtInner.executeQuery();
while( rsInner.next() )
{ {
weight += rsInner.getDouble("gross_weight");
selectCartVolume += rsInner.getDouble(2); System.out.println("item Code="+itemCode+" weight ="+weight+" no of item"+noCases);
noCases++;
//sqlInner = "select gross_weight from item_lot_packsize where item_code = ? ";
//Changed by sumit on 08/02/13 added lot in sql
//sqlInner = "select gross_weight,(length*width*height) from item_lot_packsize where item_code = ? ";
sqlInner = "select gross_weight,(length*width*height) from item_lot_packsize where item_code = ? " +
" and lot_no__from <= ? and lot_no__to >= ? ";
pstmtInner = conn.prepareStatement( sqlInner );
pstmtInner.setString( 1,itemCode );
//Changed by sumit on 08/02/13added parameter as per sql start
pstmtInner.setString( 2,lotNo );
pstmtInner.setString( 3,lotNo );
//Changed by sumit on 08/02/13added parameter as per sql end
rsInner = pstmtInner.executeQuery();
while( rsInner.next() )
{
weight += rsInner.getDouble("gross_weight");
selectCartVolume += rsInner.getDouble(2);
}
rsInner.close();
rsInner = null;
pstmtInner.close();
pstmtInner = null;
} }
rsInner.close();
rsInner = null;
pstmtInner.close();
pstmtInner = null;
} }
} }
System.out.println(" weight ="+weight+" no of item"+noCases);
//Changed by sumit on 16/01/13 changing weight size as well getting these value from dispram start
//if(weight > 70 || noCases > 60)
masterPackCount = Double.parseDouble(discommon.getDisparams("999999","MASTER_PACK_CASE_COUNT",conn));
masterPackWeight = Double.parseDouble(discommon.getDisparams("999999","MASTER_PACK_WEIGHT",conn));
//if(weight > masterPackWeight || noCases > masterPackCount )
if(weight > masterPackWeight || selectCartVolume > cartVolume || noCases > masterPackCount )
{
//Changed by sumit on 16/01/13 changing weight size as well getting these value from dispram end
errList.add( "VTWGTEXD" );
errFields.add( childNodeName.toLowerCase() );
}
System.out.println(" weight ="+weight+" no of item"+noCases);
//Changed by sumit on 16/01/13 changing weight size as well getting these value from dispram start
//if(weight > 70 || noCases > 60)
masterPackCount = Double.parseDouble(discommon.getDisparams("999999","MASTER_PACK_CASE_COUNT",conn));
masterPackWeight = Double.parseDouble(discommon.getDisparams("999999","MASTER_PACK_WEIGHT",conn));
//if(weight > masterPackWeight || noCases > masterPackCount )
if(weight > masterPackWeight || selectCartVolume > cartVolume || noCases > masterPackCount )
{
//Changed by sumit on 16/01/13 changing weight size as well getting these value from dispram end
errList.add( "VTWGTEXD" );
errFields.add( childNodeName.toLowerCase() );
}
/*innerCarton = genericUtility.getColumnValueFromNode( "carton_no", parentList.item(ctr1) ); /*innerCarton = genericUtility.getColumnValueFromNode( "carton_no", parentList.item(ctr1) );
itemCode = genericUtility.getColumnValueFromNode( "item_code", parentList.item(ctr1) ); itemCode = genericUtility.getColumnValueFromNode( "item_code", parentList.item(ctr1) );
tranID = genericUtility.getColumnValue("tran_id", hdrDom ); tranID = genericUtility.getColumnValue("tran_id", hdrDom );
...@@ -2017,4 +2065,47 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma ...@@ -2017,4 +2065,47 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma
return objName; return objName;
} }
//Changed by sumit on 12/01/13 Getting obj_name from dom end. //Changed by sumit on 12/01/13 Getting obj_name from dom end.
//Changed by sumit on 08/02/13 reteriving selected value start.
private String getAttribValue(Node detailNode, String nodeName, String attribStr)
{
String attribValue = "";
try
{
String domStr = GenericUtility.getInstance().serializeDom(detailNode);
Document dom = GenericUtility.getInstance().parseString(domStr);
if( dom != null /*&& dom.getAttributes() != null*/)
{
Node attributeNode = dom.getElementsByTagName( nodeName ).item(0);
attribValue = getAttribValue(attributeNode, attribStr);
}
}
catch(Exception e)
{
System.out.println("Exception : getAttribValue :" + e.getMessage());
}
return attribValue;
}
private String getAttribValue(Node detailNode, String attribStr)
{
String attribValue = "";
try
{
if( detailNode != null && detailNode.getAttributes() != null)
{
Node attribNode = detailNode.getAttributes().getNamedItem( attribStr );
if( attribNode != null )
{
attribValue = checkNull( attribNode.getNodeValue() );
}
}
}
catch(Exception e)
{
System.out.println("Exception : getAttribValue :" + e.getMessage());
}
return attribValue;
}
//Changed by sumit on 08/02/13 reteriving selected value end.
} }
...@@ -255,6 +255,22 @@ public class MasterPackPos extends ValidatorEJB implements MasterPackPosRemote, ...@@ -255,6 +255,22 @@ public class MasterPackPos extends ValidatorEJB implements MasterPackPosRemote,
//Ended By Mahesh Patidar //Ended By Mahesh Patidar
} }
} }
//Changed by sumit on 08/02/13 updating pack_hdr start.
else
{
int update = 0;
sql = "UPDATE PACK_HDR SET OUTER_CARTON_NO = NULL WHERE TRAN_ID = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
update = pstmt.executeUpdate();
if( update > 0)
{
System.out.println(update+" column of PACK_HDR is update successfuly ");
}
pstmt.close(); pstmt = null;
}
//Changed by sumit on 08/02/13 updating pack_hdr end.
} }
catch( Exception e ) catch( Exception e )
......
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