Commit 900b3a37 authored by amemon's avatar amemon

source updated in head without connection parameter


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@105495 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f052860a
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -15,6 +15,7 @@ import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
......@@ -47,16 +48,14 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
System.out.println("--------------ActionHandler method of Distribution Pallet Requisition ------------- : ["+tranId+"]");
String retString = "";
Connection conn = null;
//ConnDriver connDriver = new ConnDriver();
ConnDriver connDriver = new ConnDriver();
Boolean isError = false;
try
{
//Changed and Commented By Santosh on 14-06-2016 :[START]
/*conn = connDriver.getConnectDB("DriverITM");
connDriver = null;*/
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changed and Commented By Santosh on 14-06-2016 :[END]
connDriver = null;
retString = distPalletRequisition(tranId,xtraParams,forcedFlag,conn);
//String sql = "select item_code,line_no,quantity,unit,lot_no,lot_sl,mfg_date,exp_date,pallet_no from distord_issdet where dist_order = ?";
//retString = distPalletRequisition(tranId,xtraParams,forcedFlag,sql,conn);
......@@ -95,16 +94,14 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
System.out.println("--------------ActionHandler method of Sorder Pallet Requisition ------------- : ["+tranId+"]");
String retString = "";
Connection conn = null;
//ConnDriver connDriver = new ConnDriver();
ConnDriver connDriver = new ConnDriver();
Boolean isError = false;
try
{
//Changed and Commented By Santosh on 14-06-2016 :[START]
/*conn = connDriver.getConnectDB("DriverITM");
connDriver = null;*/
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changed and Commented By Santosh on 14-06-2016 :[END]
connDriver = null;
retString = sorderPalletRequisition(tranId,xtraParams,forcedFlag,conn);
//String sql = "select item_code,line_no,quantity,unit__std,lot_no,lot_sl,mfg_date,exp_date FROM sordalloc where sale_order = ?";
//retString = distPalletRequisition(tranId,xtraParams,forcedFlag,sql,conn);
......@@ -152,7 +149,10 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
palletNo = "",palletStatus = "",lockStat = "",qcType = "",stroPref = "",palletRej = "",palletRejDesc = "",confirmed = "",siteCode = "";
String transactionId = "";
Timestamp today = new Timestamp(System.currentTimeMillis());
//Timestamp today = new Timestamp(System.currentTimeMillis());
Calendar cal = Calendar.getInstance();
Timestamp expDate = null;
Timestamp mfgDate = null;
......@@ -169,6 +169,12 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
try
{
System.out.println("Inside try block distribution.....");
//changed by azhar
SimpleDateFormat dbf = new SimpleDateFormat(genericUtility.getDBDateFormat());
Timestamp today = Timestamp.valueOf(dbf.format(cal.getTime()) + " 00:00:00.0");
//changed by azhar
System.out.println("today::: " + today);
System.out.println("String date:: " + String.valueOf(today));
sql = "SELECT CONFIRMED FROM DISTORDER WHERE DIST_ORDER = ?";
pstmt = conn.prepareStatement(sql);
......@@ -434,12 +440,12 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
return errString;
}
else
{
{ System.out.println("list for mapping:: " + interfaceArrList);
commonWmsUtility.updateAwmsInterface(interfaceArrList,loginSite,conn);
}
}
else
{
{ System.out.println("list for commonsutil:: " + interfaceArrList);
commonWmsUtility.updateAwmsInterface(interfaceArrList,loginSite,conn);
}
}
......@@ -498,7 +504,7 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
double quantity = 0, noArtQuot = 0,noArtRem = 0,notArt = 0,shipperSize = 0,totalQuantity = 0,qtyPerArt = 0;
Timestamp today = new Timestamp(System.currentTimeMillis());
//Timestamp today = new Timestamp(System.currentTimeMillis());
Timestamp expDate = null;
Timestamp mfgDate = null;
......@@ -508,11 +514,16 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
loginEmpCode = checkNullAndTrim(genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginEmpCode"));
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
loginSite = checkNullAndTrim((genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginSiteCode")));
Calendar cal = Calendar.getInstance();
ArrayList interfaceArrList = new ArrayList();
try
{
//changed by azhar
SimpleDateFormat dbf = new SimpleDateFormat(genericUtility.getDBDateFormat());
Timestamp today = Timestamp.valueOf(dbf.format(cal.getTime()) + " 00:00:00.0");
//changed by azhar
System.out.println("Inside try block sale order.....");
System.out.println("Today="+today);
......@@ -726,16 +737,14 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
System.out.println("--------------Damage/Hold Stock Transfer out------------- : ["+tranId+"]");
String retString = "";
Connection conn = null;
//ConnDriver connDriver = new ConnDriver();
ConnDriver connDriver = new ConnDriver();
boolean isError = false;
try
{
//Changed and Commented By Santosh on 14-06-2016 :[START]
/*conn = connDriver.getConnectDB("DriverITM");
connDriver = null;*/
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changed and Commented By Santosh on 14-06-2016 :[END]
connDriver = null;
retString = palletRequestLock(tranId,xtraParams,forcedFlag,conn);
}
catch(Exception e)
......@@ -887,9 +896,22 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
sqlStock= " SELECT S.ITEM_CODE,S.LOC_CODE,S.SITE_CODE,S.LOT_NO,S.LOT_SL,S.QUANTITY,S.ALLOC_QTY,S.NO_ART,D.LINE_NO "
+" FROM STOCK S, INV_HOLD H,INV_HOLD_DET D"
+" WHERE S.QUANTITY > 0 AND S.ITEM_CODE = D.ITEM_CODE AND S.LOC_CODE = D. LOC_CODE AND "
+" S.SITE_CODE = D. SITE_CODE AND S.LOT_NO = D.LOT_NO AND S.LOT_SL = D.LOT_SL AND"
+" S.LOC_CODE = D.LOC_CODE AND H.TRAN_ID = D.TRAN_ID AND H.TRAN_ID = ? AND D.HOLD_STATUS != 'R' AND S.INV_STAT IN ('AWMS','AWMSQ') "; //Changed by Jagruti Shinde to request only pallet of inv_stat AWMS and AWMSQ Req id:[W16CSUN008]
+" WHERE S.QUANTITY > 0 " +
"AND S.ITEM_CODE = D.ITEM_CODE " +
/*"AND S.LOC_CODE = D. LOC_CODE " +
"AND S.SITE_CODE = D. SITE_CODE " +
"AND S.LOT_NO = D.LOT_NO " +
"AND S.LOT_SL = D.LOT_SL " +
"AND S.LOC_CODE = D.LOC_CODE" +*/
//changed by azhar on 01-MAR-2017 to handle null data[START]
"AND case when D.LOC_CODE is null then '*' else S.LOC_CODE end = case when D.LOC_CODE is null then '*' else D.LOC_CODE end " +
"AND case when D.SITE_CODE is null then '*' else S.SITE_CODE end = case when D.SITE_CODE is null then '*' else D.SITE_CODE end " +
"AND case when D.LOT_NO is null then '*' else S.LOT_NO end = case when D.LOT_NO is null then '*' else D.LOT_NO end " +
"AND case when D.LOT_SL is null then '*' else S.LOT_SL end = case when D.LOT_SL is null then '*' else D.LOT_SL end " +
"AND case when D.LOC_CODE is null then '*' else S.LOC_CODE end = case when D.LOC_CODE is null then '*' else D.LOC_CODE end " +
//changed by azhar on 01-MAR-2017 to handle null data[END]
" AND H.TRAN_ID = D.TRAN_ID AND H.TRAN_ID = ? " +
"AND D.HOLD_STATUS != 'R' AND S.INV_STAT IN ('AWMS','AWMSQ') "; //Changed by Jagruti Shinde to request only pallet of inv_stat AWMS and AWMSQ Req id:[W16CSUN008]
pstmtStock = conn.prepareStatement(sqlStock);
pstmtStock.setString(1, refId);
rsStock = pstmtStock.executeQuery();
......@@ -1010,7 +1032,8 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
//if(errString != null && (errString.indexOf("VMTRANSACN") != -1))
//{
//Changed by Jagruti Shinde Request Id:[W16CSUN008][End]
sqlUpdate = "UPDATE INV_HOLD SET REF_NO = ?, REF_SER = ? WHERE TRAN_ID = ? ";
//sqlUpdate = "UPDATE INV_HOLD SET REF_NO = ?, REF_SER = ? WHERE TRAN_ID = ? "; //commented by azhar[01/MAR/2017]
sqlUpdate = "UPDATE INV_HOLD SET REF_ID = ?, REF_SER = ? WHERE TRAN_ID = ? "; //changed by azhar[01/MAR/2017]
pstmtUpdate = conn.prepareStatement(sqlUpdate);
pstmtUpdate.setString(1, tranID);
pstmtUpdate.setString(2, "PRS");
......
......@@ -37,13 +37,13 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
{
return "";
}
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 conn1 ) throws RemoteException, ITMException
{
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
Connection conn1 = null;
//Connection conn1 = null;
String errString = "", siteCode = "", palletNo = "", sql = "", objName = "", childNodeName = "", userId = "", errorType = "", errCode = "",
tranIdDB = "";
......@@ -63,13 +63,12 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
System.out.println("::::::::::::::::: Inside postSave for palletization confirm :::::::::::::::: ");
E12GenericUtility genericUtility = new E12GenericUtility();
//Changed and Commented By Santosh on 14-06-2016 :[START]
//ConnDriver connDriver = new ConnDriver();
//conn1 = connDriver.getConnectDB("DriverITM");
conn1 = getConnection();
//commented by azhar[06-MAR-17][START]
/*ConnDriver connDriver = new ConnDriver();
conn1 = connDriver.getConnectDB("DriverITM");
conn1.setAutoCommit(false);
//connDriver = null;
//Changed and Commented By Santosh on 14-06-2016 :[END]
connDriver = null;*/
//commented by azhar[06-MAR-17][END]
Document dom = null;
dom = genericUtility.parseString(domString);
......@@ -126,7 +125,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
else
{
System.out.println("Calling confirm for palletization confirm menu :::::::::::::::::::: ");
confirm(tranIdDB, siteCode, conn1);
errString = confirm(tranIdDB, siteCode, conn1);
}
}
......@@ -144,7 +143,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
else
{
System.out.println("Calling confirm for palletization confirm menu :::::::::::::::::::: ");
confirm(tranId, siteCode, conn1);
errString = confirm(tranId, siteCode, conn1);
}
}
}
......@@ -187,7 +186,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
else
{
System.out.println("Calling confirm for palletization confirm menu :::::::::::::::::::: ");
confirm(tranId, siteCode, conn1);
errString = confirm(tranId, siteCode, conn1);
}
}
}
......@@ -260,19 +259,21 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
{
if( !isError )
{
System.out.println("commmit");
conn1.commit();
System.out.println("commmit in PalletizationConf");
//conn1.commit(); //commented by azhar[06-MAR-17]
}
else if ( isError )
{
System.out.println("rollback");
conn1.rollback();
}
if (conn1 != null)
//commented by azhar[06-MAR-17][START]
/*if (conn1 != null)
{
conn1.close();
conn1 = null;
}
}*/
//commented by azhar[06-MAR-17][END]
}
catch(Exception e)
{
......@@ -433,30 +434,32 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
return count;
}
public void confirm( String tranId, String siteCode, Connection conn1 ) throws Exception
public String confirm( String tranId, String siteCode, Connection conn1 ) throws Exception
{
String sql = "", tranDate = "", invStat = "", qcType = "",
String sql = "", tranDate = "", invStat = "", qcType = "",errString = "",
expDate = "", mfgDate = "", palletStatus = "", qcReqd = "", procMth = "", lineNoInterface = "", familyGrp = "",
stroPref = "",stroPrefF="",stroPrefM="",stroPrefS="",stroPrefR="";
double holdQuantity = 0, quantityDB = 0, packSize = 0, interfaceQty = 0, interfaceQtyRem = 0, totQuantity = 0, qtyPerArt = 0, noArt = 0;
PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null, rs1 = null;
boolean isError = false;
boolean isError = false, isLocalConn = false;
DistCommon distComm = new DistCommon();
String nexpLoc = "", lockCode = "", expLoc = "";
ArrayList interfaceArrList = new ArrayList();
//Changed and Commented By Santosh on 14-06-2016 :[START]
//ConnDriver connDriver = new ConnDriver();
if(conn1 == null){
ConnDriver connDriver = new ConnDriver();
//conn1 = connDriver.getConnectDB("DriverITM");
conn1 = getConnection();
//Changed and Commented By Santosh on 14-06-2016 :[END]
isLocalConn = true;
}
int interfaceQty1 = 0;
//Changed By Jagruti Shinde on 4/1/2016 Request Id:W15JSUN001[Start]
stroPrefF = distComm.getDisparams("999999", "AWMS_FAST_MOVING", conn1);
stroPrefM = distComm.getDisparams("999999", "AWMS_MEDIUM_MOVING", conn1);
stroPrefS = distComm.getDisparams("999999", "AWMS_SLOW_MOVING", conn1);
//Changed By Jagruti Shinde on 4/1/2016 Request Id:W15JSUN001[End]
Calendar cal = Calendar.getInstance();
try
{
System.out.println("::::::::::::::::: Inside confirm for palletization confirm :::::::::::::::: ");
......@@ -465,7 +468,12 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
CommonWmsUtil commonWmsUtility = CommonWmsUtil.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility();
Date today = new Timestamp(System.currentTimeMillis());
//Date today = new Timestamp(System.currentTimeMillis()); //commented by azhar to avoid date with timestamp[13-APR-2017]
//added by azhar to avoid date with timestamp[13-APR-2017][START]
SimpleDateFormat dbf = new SimpleDateFormat(genericUtility.getDBDateFormat());
Timestamp today = Timestamp.valueOf(dbf.format(cal.getTime()) + " 00:00:00.0");
//added by azhar to avoid date with timestamp[13-APR-2017][END]
sql = "update pallet_hdr set confirmed = ?, conf_date = ? where tran_id = ? ";
pstmt = conn1.prepareStatement(sql);
......@@ -719,7 +727,8 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
}
commonWmsUtility.updateAwmsInterface(interfaceArrList, siteCode, conn1);
errString = commonWmsUtility.updateAwmsInterface(interfaceArrList, siteCode, conn1);
System.out.println("Inserted into interface2 table ::::::::::::: ");
if(pstmt != null){ pstmt.close(); pstmt = null; }
......@@ -730,6 +739,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
isError = true;
System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace();
errString = ex.getMessage();
throw new ITMException(ex);
}
catch (Exception e)
......@@ -737,20 +747,27 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
isError = true;
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
errString = e.getMessage();
throw new ITMException(e);
}
finally
{
//commented by azhar[06-MAR-17][START]
if(isLocalConn){
if( !isError )
{
System.out.println("commmit");
conn1.commit();
}
else if ( isError )
{
System.out.println("rollback");
conn1.rollback();
}
conn1.close();
}
//commented by azhar[06-MAR-17][END]
if(rs!=null)
{
rs.close();
......@@ -763,6 +780,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
}
}
return errString;
}
public String getError(String tranId, String Code, Connection conn) throws ITMException, Exception
......
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