Commit 535e445b authored by smestry's avatar smestry

W15FSUN008, Create transaction screen Palletization and palletization Confirm for AWMS.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98817 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9d58a786
...@@ -40,10 +40,7 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo ...@@ -40,10 +40,7 @@ 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 = "", sql = "", siteCode = "", interfaceTranId = "", objName = "", lineNo = "", locCode = "", palletNo = "", String errString = "", siteCode = "",lineNo = "", locCode = "", itemCode = "", lotNo = "", lotSl = "", quantity = "";
PalletNoSource = "", itemCode = "", lotNo = "", lotSl = "", quantity = "";
PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null, rs1 = null;
double parseQuantity = 0; double parseQuantity = 0;
HashMap strAllocate = new HashMap(); HashMap strAllocate = new HashMap();
Connection conn1 = null; Connection conn1 = null;
...@@ -65,15 +62,17 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo ...@@ -65,15 +62,17 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
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") ; java.sql.Timestamp tranDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString( currDateStr , applDateFormat, dbDateFormat ) + " 00:00:00.0") ;
System.out.println("Calling Post Save ::::::::::::: " ); System.out.println("Calling Post Save for Palletization ::::::::::::: " );
System.out.println("domString ::::::::::::: " + domString); System.out.println("domString ::::::::::::: " + domString);
System.out.println("xtraParams ::::::::::::: " + xtraParams); System.out.println("xtraParams ::::::::::::: " + xtraParams);
System.out.println("tranId ::::::::::::: " + tranId); System.out.println("tranId ::::::::::::: " + tranId);
lineNo = checkNull(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) if( tranId != null && tranId.trim().length() > 0 && lineNo != null && lineNo.trim().length() > 0)
{ {
System.out.println("Inside if for post save palletization ::::::::: " );
siteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" )); siteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" ));
itemCode = checkNull(genericUtility.getColumnValue("item_code", dom, "3" )); itemCode = checkNull(genericUtility.getColumnValue("item_code", dom, "3" ));
locCode = checkNull(genericUtility.getColumnValue("loc_code", dom, "3" )); locCode = checkNull(genericUtility.getColumnValue("loc_code", dom, "3" ));
...@@ -89,42 +88,30 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo ...@@ -89,42 +88,30 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
System.out.println("lotNo----------->>["+lotNo+"]"); System.out.println("lotNo----------->>["+lotNo+"]");
System.out.println("lotSl----------->>["+lotSl+"]"); System.out.println("lotSl----------->>["+lotSl+"]");
sql = "select * from INVALLOC_TRACE where ref_id = ? and ref_line = ? "; strAllocate.put("tran_date", tranDate);
pstmt = conn1.prepareStatement(sql); strAllocate.put("ref_ser","PZ");
pstmt.setString(1, tranId); strAllocate.put("ref_id", tranId);
pstmt.setString(2, lineNo); strAllocate.put("ref_line", lineNo);
rs = pstmt.executeQuery(); strAllocate.put("site_code", siteCode);
if(!rs.next()) strAllocate.put("item_code", itemCode);
{ strAllocate.put("loc_code", locCode);
System.out.println("Inside if for post save palletization ::::::::: " ); strAllocate.put("lot_no", lotNo);
strAllocate.put("lot_sl", lotSl);
strAllocate.put("tran_date", tranDate); strAllocate.put("alloc_qty", parseQuantity) ;
strAllocate.put("ref_ser","PZ"); strAllocate.put("chg_user", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"loginCode"));
strAllocate.put("ref_id", tranId); strAllocate.put("chg_term", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"termId"));
strAllocate.put("ref_line", lineNo); strAllocate.put("chg_win", "W_PALLETIZATION");
strAllocate.put("site_code", siteCode);
strAllocate.put("item_code", itemCode); errString = invAllocTrace.updateInvallocTrace(strAllocate, conn1);
strAllocate.put("loc_code", locCode);
strAllocate.put("lot_no", lotNo); System.out.println("errString ::: " + errString);
strAllocate.put("lot_sl", lotSl); if (errString != null && errString.trim().length() > 0 )
strAllocate.put("alloc_qty", parseQuantity) ; {
strAllocate.put("chg_user", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"loginCode")); return errString;
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 )
{
return errString;
}
strAllocate = null;
System.out.println("Allocated the quantity in stock::::::::::: ");
} }
if(pstmt1 != null){pstmt1.close();pstmt1 = null;} strAllocate = null;
if(rs1 != null){rs1.close();rs1 = null;} System.out.println("Allocated the quantity in stock::::::::::: ");
} }
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -144,26 +131,6 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo ...@@ -144,26 +131,6 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
{ {
try try
{ {
if( rs != null )
{
rs.close();
rs = null;
}
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
if( rs1 != null )
{
rs1.close();
rs1 = null;
}
if( pstmt1 != null )
{
pstmt1.close();
pstmt1 = null;
}
if (conn1 != null) if (conn1 != null)
{ {
conn1.close(); conn1.close();
...@@ -200,82 +167,6 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo ...@@ -200,82 +167,6 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
} }
return inputVal; return inputVal;
} }
private String generateTranTd( String windowName, String tranDate, String siteCode, Connection conn1 )throws ITMException
{
System.out.println("inside generateTranTd@@.........");
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "";
String tranId = "";
String tranSer1 = "",keyString = "",keyCol = "";
CommonConstants commonConstants = new CommonConstants();
try
{
sql = "SELECT KEY_STRING, TRAN_ID_COL, REF_SER FROM TRANSETUP WHERE TRAN_WINDOW = ? ";
pstmt = conn1.prepareStatement(sql);
pstmt.setString(1, windowName);
rs = pstmt.executeQuery();
System.out.println("keyString :"+sql);
if (rs.next())
{
keyString = rs.getString(1);
keyCol = rs.getString(2);
tranSer1 = rs.getString(3);
}
else
{
sql = "SELECT KEY_STRING, TRAN_ID_COL, REF_SER FROM TRANSETUP WHERE TRAN_WINDOW = ? ";
pstmt = conn1.prepareStatement(sql);
pstmt.setString(1, "GENERAL");
rs = pstmt.executeQuery();
System.out.println("keyString :"+sql);
if (rs.next())
{
keyString = rs.getString(1);
keyCol = rs.getString(2);
tranSer1 = rs.getString(3);
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("keyString :"+keyString);
System.out.println("keyCol :"+keyCol);
System.out.println("tranSer1 :"+tranSer1);
String xmlValues = "";
xmlValues ="<?xml version=\"1.0\" encoding=\"utf-8\"?><Root>";
xmlValues = xmlValues + "<Header></Header>";
xmlValues = xmlValues + "<Detail1>";
xmlValues = xmlValues + "<tran_id></tran_id>";
xmlValues = xmlValues + "<site_code>" + siteCode + "</site_code>";
xmlValues = xmlValues + "<tran_date>"+ tranDate + "</tran_date>";
xmlValues = xmlValues + "<tran_type>"+"U"+"</tran_type>";
xmlValues = xmlValues + "</Detail1></Root>";
System.out.println("xmlValues :["+xmlValues+"]");
TransIDGenerator tg = new TransIDGenerator(xmlValues, "BASE", commonConstants.DB_NAME);
tranId = tg.generateTranSeqID(tranSer1, keyCol, keyString, conn1);
System.out.println("tranId ::"+tranId);
}
catch (SQLException ex)
{
System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace();
throw new ITMException(ex);
}
catch (Exception e)
{
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
return tranId;
}
} }
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