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; ...@@ -15,6 +15,7 @@ import java.sql.SQLException;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
...@@ -47,16 +48,14 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -47,16 +48,14 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
System.out.println("--------------ActionHandler method of Distribution Pallet Requisition ------------- : ["+tranId+"]"); System.out.println("--------------ActionHandler method of Distribution Pallet Requisition ------------- : ["+tranId+"]");
String retString = ""; String retString = "";
Connection conn = null; Connection conn = null;
//ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
Boolean isError = false; Boolean isError = false;
try try
{ {
//Changed and Commented By Santosh on 14-06-2016 :[START] //conn = connDriver.getConnectDB("DriverITM");
/*conn = connDriver.getConnectDB("DriverITM");
connDriver = null;*/
conn = getConnection(); conn = getConnection();
//Changed and Commented By Santosh on 14-06-2016 :[END] connDriver = null;
retString = distPalletRequisition(tranId,xtraParams,forcedFlag,conn); 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 = ?"; //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); //retString = distPalletRequisition(tranId,xtraParams,forcedFlag,sql,conn);
...@@ -95,16 +94,14 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -95,16 +94,14 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
System.out.println("--------------ActionHandler method of Sorder Pallet Requisition ------------- : ["+tranId+"]"); System.out.println("--------------ActionHandler method of Sorder Pallet Requisition ------------- : ["+tranId+"]");
String retString = ""; String retString = "";
Connection conn = null; Connection conn = null;
//ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
Boolean isError = false; Boolean isError = false;
try try
{ {
//Changed and Commented By Santosh on 14-06-2016 :[START] //conn = connDriver.getConnectDB("DriverITM");
/*conn = connDriver.getConnectDB("DriverITM");
connDriver = null;*/
conn = getConnection(); conn = getConnection();
//Changed and Commented By Santosh on 14-06-2016 :[END] connDriver = null;
retString = sorderPalletRequisition(tranId,xtraParams,forcedFlag,conn); 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 = ?"; //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); //retString = distPalletRequisition(tranId,xtraParams,forcedFlag,sql,conn);
...@@ -152,7 +149,10 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -152,7 +149,10 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
palletNo = "",palletStatus = "",lockStat = "",qcType = "",stroPref = "",palletRej = "",palletRejDesc = "",confirmed = "",siteCode = ""; palletNo = "",palletStatus = "",lockStat = "",qcType = "",stroPref = "",palletRej = "",palletRejDesc = "",confirmed = "",siteCode = "";
String transactionId = ""; String transactionId = "";
Timestamp today = new Timestamp(System.currentTimeMillis()); //Timestamp today = new Timestamp(System.currentTimeMillis());
Calendar cal = Calendar.getInstance();
Timestamp expDate = null; Timestamp expDate = null;
Timestamp mfgDate = null; Timestamp mfgDate = null;
...@@ -169,6 +169,12 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -169,6 +169,12 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
try try
{ {
System.out.println("Inside try block distribution....."); 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 = ?"; sql = "SELECT CONFIRMED FROM DISTORDER WHERE DIST_ORDER = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -434,12 +440,12 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -434,12 +440,12 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
return errString; return errString;
} }
else else
{ { System.out.println("list for mapping:: " + interfaceArrList);
commonWmsUtility.updateAwmsInterface(interfaceArrList,loginSite,conn); commonWmsUtility.updateAwmsInterface(interfaceArrList,loginSite,conn);
} }
} }
else else
{ { System.out.println("list for commonsutil:: " + interfaceArrList);
commonWmsUtility.updateAwmsInterface(interfaceArrList,loginSite,conn); commonWmsUtility.updateAwmsInterface(interfaceArrList,loginSite,conn);
} }
} }
...@@ -498,7 +504,7 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -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; 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 expDate = null;
Timestamp mfgDate = null; Timestamp mfgDate = null;
...@@ -508,11 +514,16 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -508,11 +514,16 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
loginEmpCode = checkNullAndTrim(genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginEmpCode")); loginEmpCode = checkNullAndTrim(genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginEmpCode"));
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode"); userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
loginSite = checkNullAndTrim((genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginSiteCode"))); loginSite = checkNullAndTrim((genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginSiteCode")));
Calendar cal = Calendar.getInstance();
ArrayList interfaceArrList = new ArrayList(); ArrayList interfaceArrList = new ArrayList();
try 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("Inside try block sale order.....");
System.out.println("Today="+today); System.out.println("Today="+today);
...@@ -726,16 +737,14 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -726,16 +737,14 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
System.out.println("--------------Damage/Hold Stock Transfer out------------- : ["+tranId+"]"); System.out.println("--------------Damage/Hold Stock Transfer out------------- : ["+tranId+"]");
String retString = ""; String retString = "";
Connection conn = null; Connection conn = null;
//ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
boolean isError = false; boolean isError = false;
try try
{ {
//Changed and Commented By Santosh on 14-06-2016 :[START] //conn = connDriver.getConnectDB("DriverITM");
/*conn = connDriver.getConnectDB("DriverITM");
connDriver = null;*/
conn = getConnection(); conn = getConnection();
//Changed and Commented By Santosh on 14-06-2016 :[END] connDriver = null;
retString = palletRequestLock(tranId,xtraParams,forcedFlag,conn); retString = palletRequestLock(tranId,xtraParams,forcedFlag,conn);
} }
catch(Exception e) catch(Exception e)
...@@ -887,9 +896,22 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -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 " 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" +" 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 " +" WHERE S.QUANTITY > 0 " +
+" S.SITE_CODE = D. SITE_CODE AND S.LOT_NO = D.LOT_NO AND S.LOT_SL = D.LOT_SL AND" "AND S.ITEM_CODE = D.ITEM_CODE " +
+" 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] /*"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 = conn.prepareStatement(sqlStock);
pstmtStock.setString(1, refId); pstmtStock.setString(1, refId);
rsStock = pstmtStock.executeQuery(); rsStock = pstmtStock.executeQuery();
...@@ -1010,7 +1032,8 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -1010,7 +1032,8 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
//if(errString != null && (errString.indexOf("VMTRANSACN") != -1)) //if(errString != null && (errString.indexOf("VMTRANSACN") != -1))
//{ //{
//Changed by Jagruti Shinde Request Id:[W16CSUN008][End] //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 = conn.prepareStatement(sqlUpdate);
pstmtUpdate.setString(1, tranID); pstmtUpdate.setString(1, tranID);
pstmtUpdate.setString(2, "PRS"); pstmtUpdate.setString(2, "PRS");
......
...@@ -37,13 +37,13 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -37,13 +37,13 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
{ {
return ""; 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 parentNodeList = null;
NodeList childNodeList = null; NodeList childNodeList = null;
Node parentNode = null; Node parentNode = null;
Node childNode = null; Node childNode = null;
Connection conn1 = null; //Connection conn1 = null;
String errString = "", siteCode = "", palletNo = "", sql = "", objName = "", childNodeName = "", userId = "", errorType = "", errCode = "", String errString = "", siteCode = "", palletNo = "", sql = "", objName = "", childNodeName = "", userId = "", errorType = "", errCode = "",
tranIdDB = ""; tranIdDB = "";
...@@ -63,13 +63,12 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -63,13 +63,12 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
System.out.println("::::::::::::::::: Inside postSave for palletization confirm :::::::::::::::: "); System.out.println("::::::::::::::::: Inside postSave for palletization confirm :::::::::::::::: ");
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
//Changed and Commented By Santosh on 14-06-2016 :[START] //commented by azhar[06-MAR-17][START]
//ConnDriver connDriver = new ConnDriver(); /*ConnDriver connDriver = new ConnDriver();
//conn1 = connDriver.getConnectDB("DriverITM"); conn1 = connDriver.getConnectDB("DriverITM");
conn1 = getConnection();
conn1.setAutoCommit(false); conn1.setAutoCommit(false);
//connDriver = null; connDriver = null;*/
//Changed and Commented By Santosh on 14-06-2016 :[END] //commented by azhar[06-MAR-17][END]
Document dom = null; Document dom = null;
dom = genericUtility.parseString(domString); dom = genericUtility.parseString(domString);
...@@ -126,7 +125,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -126,7 +125,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
else else
{ {
System.out.println("Calling confirm for palletization confirm menu :::::::::::::::::::: "); 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 ...@@ -144,7 +143,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
else else
{ {
System.out.println("Calling confirm for palletization confirm menu :::::::::::::::::::: "); 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 ...@@ -187,7 +186,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
else else
{ {
System.out.println("Calling confirm for palletization confirm menu :::::::::::::::::::: "); 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 ...@@ -260,19 +259,21 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
{ {
if( !isError ) if( !isError )
{ {
System.out.println("commmit"); System.out.println("commmit in PalletizationConf");
conn1.commit(); //conn1.commit(); //commented by azhar[06-MAR-17]
} }
else if ( isError ) else if ( isError )
{ {
System.out.println("rollback"); System.out.println("rollback");
conn1.rollback(); conn1.rollback();
} }
if (conn1 != null) //commented by azhar[06-MAR-17][START]
/*if (conn1 != null)
{ {
conn1.close(); conn1.close();
conn1 = null; conn1 = null;
} }*/
//commented by azhar[06-MAR-17][END]
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -433,30 +434,32 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -433,30 +434,32 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
return count; 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 = "", expDate = "", mfgDate = "", palletStatus = "", qcReqd = "", procMth = "", lineNoInterface = "", familyGrp = "",
stroPref = "",stroPrefF="",stroPrefM="",stroPrefS="",stroPrefR=""; stroPref = "",stroPrefF="",stroPrefM="",stroPrefS="",stroPrefR="";
double holdQuantity = 0, quantityDB = 0, packSize = 0, interfaceQty = 0, interfaceQtyRem = 0, totQuantity = 0, qtyPerArt = 0, noArt = 0; double holdQuantity = 0, quantityDB = 0, packSize = 0, interfaceQty = 0, interfaceQtyRem = 0, totQuantity = 0, qtyPerArt = 0, noArt = 0;
PreparedStatement pstmt = null, pstmt1 = null; PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null, rs1 = null; ResultSet rs = null, rs1 = null;
boolean isError = false; boolean isError = false, isLocalConn = false;
DistCommon distComm = new DistCommon(); DistCommon distComm = new DistCommon();
String nexpLoc = "", lockCode = "", expLoc = ""; String nexpLoc = "", lockCode = "", expLoc = "";
ArrayList interfaceArrList = new ArrayList(); ArrayList interfaceArrList = new ArrayList();
//Changed and Commented By Santosh on 14-06-2016 :[START] if(conn1 == null){
//ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
//conn1 = connDriver.getConnectDB("DriverITM"); //conn1 = connDriver.getConnectDB("DriverITM");
conn1 = getConnection(); conn1 = getConnection();
//Changed and Commented By Santosh on 14-06-2016 :[END] isLocalConn = true;
}
int interfaceQty1 = 0; int interfaceQty1 = 0;
//Changed By Jagruti Shinde on 4/1/2016 Request Id:W15JSUN001[Start] //Changed By Jagruti Shinde on 4/1/2016 Request Id:W15JSUN001[Start]
stroPrefF = distComm.getDisparams("999999", "AWMS_FAST_MOVING", conn1); stroPrefF = distComm.getDisparams("999999", "AWMS_FAST_MOVING", conn1);
stroPrefM = distComm.getDisparams("999999", "AWMS_MEDIUM_MOVING", conn1); stroPrefM = distComm.getDisparams("999999", "AWMS_MEDIUM_MOVING", conn1);
stroPrefS = distComm.getDisparams("999999", "AWMS_SLOW_MOVING", conn1); stroPrefS = distComm.getDisparams("999999", "AWMS_SLOW_MOVING", conn1);
//Changed By Jagruti Shinde on 4/1/2016 Request Id:W15JSUN001[End] //Changed By Jagruti Shinde on 4/1/2016 Request Id:W15JSUN001[End]
Calendar cal = Calendar.getInstance();
try try
{ {
System.out.println("::::::::::::::::: Inside confirm for palletization confirm :::::::::::::::: "); System.out.println("::::::::::::::::: Inside confirm for palletization confirm :::::::::::::::: ");
...@@ -465,7 +468,12 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -465,7 +468,12 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
CommonWmsUtil commonWmsUtility = CommonWmsUtil.getInstance(); CommonWmsUtil commonWmsUtility = CommonWmsUtil.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility(); 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 = ? "; sql = "update pallet_hdr set confirmed = ?, conf_date = ? where tran_id = ? ";
pstmt = conn1.prepareStatement(sql); pstmt = conn1.prepareStatement(sql);
...@@ -719,7 +727,8 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -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 ::::::::::::: "); System.out.println("Inserted into interface2 table ::::::::::::: ");
if(pstmt != null){ pstmt.close(); pstmt = null; } if(pstmt != null){ pstmt.close(); pstmt = null; }
...@@ -730,6 +739,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -730,6 +739,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
isError = true; isError = true;
System.out.println("Exception ::" +sql+ ex.getMessage() + ":"); System.out.println("Exception ::" +sql+ ex.getMessage() + ":");
ex.printStackTrace(); ex.printStackTrace();
errString = ex.getMessage();
throw new ITMException(ex); throw new ITMException(ex);
} }
catch (Exception e) catch (Exception e)
...@@ -737,20 +747,27 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -737,20 +747,27 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
isError = true; isError = true;
System.out.println("Exception ::" + e.getMessage() + ":"); System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
errString = e.getMessage();
throw new ITMException(e); throw new ITMException(e);
} }
finally finally
{ {
//commented by azhar[06-MAR-17][START]
if(isLocalConn){
if( !isError ) if( !isError )
{ {
System.out.println("commmit"); System.out.println("commmit");
conn1.commit(); conn1.commit();
} }
else if ( isError ) else if ( isError )
{ {
System.out.println("rollback"); System.out.println("rollback");
conn1.rollback(); conn1.rollback();
} }
conn1.close();
}
//commented by azhar[06-MAR-17][END]
if(rs!=null) if(rs!=null)
{ {
rs.close(); rs.close();
...@@ -763,6 +780,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -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 public String getError(String tranId, String Code, Connection conn) throws ITMException, Exception
......
...@@ -19,6 +19,7 @@ import java.sql.Date; ...@@ -19,6 +19,7 @@ import java.sql.Date;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import org.apache.xerces.dom.AttributeMap;
import org.w3c.dom.*; import org.w3c.dom.*;
@javax.ejb.Stateless @javax.ejb.Stateless
...@@ -95,24 +96,27 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -95,24 +96,27 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
@Override @Override
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String xtraParams) throws RemoteException, ITMException public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String xtraParams) throws RemoteException, ITMException
{ {
NodeList parentNodeList = null; NodeList parentNodeList = null,parentNodeListNew = null;
NodeList childNodeList = null; NodeList childNodeList = null,childNodeListNew = null;
Node parentNode = null; Node parentNode = null,parentNodeNew = null;
Node childNode = null; Node childNode = null,childNodeNew = null;
Connection conn = null; Connection conn = null;
E12GenericUtility genericUtility; E12GenericUtility genericUtility;
StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>"); StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>");
String loginSite = "", userId = "", childNodeName = "", errorType = "", errCode = "", errString = "",locGroupDisp="", String loginSite = "", userId = "", childNodeName = "", errorType = "", errCode = "", errString = "",locGroupDisp="",
itemSql="",StatusSql="",status ="",itemRgSql="",locSql="",locGroup="",itemSer="",itemSerRgDisparm="",itemCode="",lotNo="", itemSql="",StatusSql="",status ="",itemRgSql="",locSql="",locGroup="",itemSer="",itemSerRgDisparm="",itemCode="",lotNo="",lotNoPrev= "",lotSlPrev = "",
locSuffixDisp="",stkSql="",lastCharS="" ,sqlTranId = "" ,tranId =""; locSuffixDisp="",stkSql="",lastCharS="" ,sqlTranId = "" ,tranId ="";
int currentFormNo = 0, childNodeListLength = 0, cnt = 0, ctr = 0 ,palletHdrCount = 0 ,stockCount = 0,countPalletDetLot =0;//Added by Jagruti Shinde Req id:[W16GSUN003] int currentFormNo = 0, childNodeListLength = 0, cnt = 0, ctr = 0 ,palletHdrCount = 0 ,stockCount = 0,countPalletDetLot =0;//Added by Jagruti Shinde Req id:[W16GSUN003]
int childNodeListLengthNew = 0;
char lastChar ; char lastChar ;
ArrayList <String> errList = new ArrayList<String>(); ArrayList <String> errList = new ArrayList<String>();
ArrayList <String> errFields = new ArrayList <String> (); ArrayList <String> errFields = new ArrayList <String> ();
//Added by Jagruti Shinde Request id:[W16GSUN003] //Added by Jagruti Shinde Request id:[W16GSUN003]
double PalletSwmsQty ; double PalletSwmsQty ;
ITMDBAccessEJB itmdbAccess = new ITMDBAccessEJB(); ITMDBAccessEJB itmdbAccess = new ITMDBAccessEJB();
List<String> lotSlList = new ArrayList<String>();
HashMap<String, Integer> lotSlMap = new HashMap<String, Integer>();
try try
{ {
...@@ -126,13 +130,11 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -126,13 +130,11 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
loginSite = checkNull(genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" )); loginSite = checkNull(genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" ));
//Changed and Commented By Santosh on 14-06-2016 :[START] ConnDriver connDriver = new ConnDriver();
/*ConnDriver connDriver = new ConnDriver(); //conn = connDriver.getConnectDB("DriverITM");
conn = connDriver.getConnectDB("DriverITM");*/
conn = getConnection(); conn = getConnection();
conn.setAutoCommit(false); conn.setAutoCommit(false);
//connDriver = null; connDriver = null;
//Changed and Commented By Santosh on 14-06-2016 :[END]
userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode"); userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
if (objContext != null && objContext.trim().length() > 0) if (objContext != null && objContext.trim().length() > 0)
...@@ -425,6 +427,56 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -425,6 +427,56 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no",dom1)); palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no",dom1));
qcSampleType = checkNullAndTrim(genericUtility.getColumnValue("qc_sample_type", dom)); qcSampleType = checkNullAndTrim(genericUtility.getColumnValue("qc_sample_type", dom));
parentNodeListNew = dom2.getElementsByTagName("Detail3");
System.out.println("parent nodelist length:: " + parentNodeListNew.getLength());
for(int i = 0; i< parentNodeListNew.getLength();i++){
parentNodeNew = parentNodeListNew.item(i);
childNodeListNew = parentNodeNew.getChildNodes();
childNodeListLengthNew = childNodeListNew.getLength();
for(int j = 0;j < childNodeListLengthNew;j++){
childNodeNew = childNodeListNew.item(j);
if(childNodeNew.getNodeType() != Node.ELEMENT_NODE )
{
continue;
}
if(childNodeNew != null && childNodeNew.getFirstChild() != null){
if("lot_no".equalsIgnoreCase(checkNull(childNodeNew.getNodeName()))){
lotNoPrev = childNodeNew.getFirstChild().getNodeValue().trim();
System.out.println("lotno previous dom::["+lotNoPrev+"]:::");
}
if("lot_sl".equalsIgnoreCase(checkNull(childNodeNew.getNodeName()))){
lotSlPrev = childNodeNew.getFirstChild().getNodeValue().trim();
System.out.println("::lot sl previous dom ::["+lotSlPrev+"]");
}
}
}
lotNoPrev = lotNoPrev == null ? "" : lotNoPrev;
lotSlPrev = lotSlPrev == null ? "" : lotSlPrev;
System.out.println("lotno previous::["+lotNoPrev+"]::lot sl previous::["+lotSlPrev+"]");
/*if(!lotSlList.contains(lotSlPrev)){
lotSlList.add(lotSlPrev);
}
System.out.println("list::" + lotSlList);*/
if(!lotSlMap.containsKey(lotSlPrev)){
int countLotSl = 1;
lotSlMap.put(lotSlPrev.trim(), countLotSl++);
}else{
lotSlMap.put(lotSlPrev.trim(), lotSlMap.get(lotSlPrev) + 1);
}
}
System.out.println("map::: " + lotSlMap);
if(lotSlMap.get(lotSl) > 1){
return itmdbAccess.getErrorString("", "VTINOUTIT", "");
}
System.out.println("itemCode :::::::::::::: " + itemCode); System.out.println("itemCode :::::::::::::: " + itemCode);
System.out.println("quantity :::::::::::::: " + quantity); System.out.println("quantity :::::::::::::: " + quantity);
...@@ -1310,6 +1362,10 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1310,6 +1362,10 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
System.out.println("PalletizationCalled123........................... : ["+currentColumn+"]"); System.out.println("PalletizationCalled123........................... : ["+currentColumn+"]");
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
NodeList parenNodeList = null,childNodeList1 = null;
Node parentNode1 = null, childNode1 = null;
int childNodeListLength1 = 0,parentNodeListLength = 0;
String childNodeName = "";
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n<Header>\r\n<editFlag>").append( editFlag ); valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n<Header>\r\n<editFlag>").append( editFlag );
try try
{ {
...@@ -1323,12 +1379,9 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1323,12 +1379,9 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
chgTerm = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId")); chgTerm = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"));
System.out.println("loginEmpCode---->>["+loginEmpCode+"] chgUser---->>["+chgUser+"]"); System.out.println("loginEmpCode---->>["+loginEmpCode+"] chgUser---->>["+chgUser+"]");
//Changed and Commented By Santosh on 14-06-2016 :[START] ConnDriver connDriver = new ConnDriver();
/*ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB( "DriverITM" ); conn = connDriver.getConnectDB( "DriverITM" );
connDriver = null;*/ connDriver = null;
conn = getConnection();
//Changed and Commented By Santosh on 14-06-2016 :[END]
if( objContext != null && objContext.trim().length() > 0 ) if( objContext != null && objContext.trim().length() > 0 )
{ {
...@@ -1552,13 +1605,52 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1552,13 +1605,52 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{ {
System.out.println("--------------inside itm_default_add ----------------------"); System.out.println("--------------inside itm_default_add ----------------------");
lineNo = getMaxLineNo(tranId, palletNo, loginSite, conn);
System.out.println("lineNo in itm_default_add :::::::::::::: " + lineNo); int tmpLineNo=0;
NodeList parentList = allFormDataDom.getElementsByTagName("Detail3");
parentNodeListLength = parentList.getLength();
System.out.println((new StringBuilder("parentNodeListLength[")).append(parentNodeListLength).append("]").toString());
for (int prntCtr = 0; prntCtr < parentNodeListLength; prntCtr++)
{
parentNode1 = parentList.item(prntCtr);
AttributeMap attrMap = (AttributeMap) parentNode1.getAttributes();
System.out.println("[" + prntCtr + "] Node domID [" + attrMap.getNamedItem("domID").getLocalName() + ":" + attrMap.getNamedItem("domID").getNodeValue() + "]");
lineNo = Integer.parseInt(attrMap.getNamedItem("domID").getNodeValue());
System.out.println("lineNo----" + lineNo);
childNodeList1 = parentNode1.getChildNodes();
childNodeListLength1 = childNodeList1.getLength();
System.out.println("childNodeListLength1::: "+ childNodeListLength1+"\n");
for (int childRow = 0; childRow < childNodeListLength1; childRow++)
{
childNode1 = childNodeList1.item(childRow);
childNodeName = childNode1.getNodeName();
System.out.println("childNodeName :"+childNodeName);
if (childNodeName.equals("line_no"))
{
if(childNode1.getFirstChild()!=null)
{
lineNo = Integer.parseInt(childNode1.getFirstChild().getNodeValue().trim());
System.out.println("Detail3 lineNo:::]" +lineNo);
if(tmpLineNo<=lineNo)
{
tmpLineNo=lineNo;
}
}
}
System.out.println("childRow :"+childRow);
System.out.println("childNodeListLength1 :"+childNodeListLength1);
}
}
tmpLineNo++;
//lineNo = getMaxLineNo(tranId, palletNo, loginSite, conn);
System.out.println("lineNo in itm_default_add :::::::::::::: " + tmpLineNo);
if( tranId != null && tranId.trim().length() > 0 ) // edit mode if( tranId != null && tranId.trim().length() > 0 ) // edit mode
{ {
valueXmlString.append("<Detail3 domID='"+lineNo+"' selected=\"N\">\r\n"); valueXmlString.append("<Detail3 domID='"+tmpLineNo+"' selected=\"N\">\r\n");
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n"); valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
valueXmlString.append( "<tran_id><![CDATA[" ).append( tranId ).append( "]]></tran_id>\r\n" ); valueXmlString.append( "<tran_id><![CDATA[" ).append( tranId ).append( "]]></tran_id>\r\n" );
...@@ -1566,7 +1658,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1566,7 +1658,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
} }
else else
{ {
valueXmlString.append("<Detail3 domID='"+lineNo+"' selected=\"N\">\r\n"); valueXmlString.append("<Detail3 domID='"+tmpLineNo+"' selected=\"N\">\r\n");
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n"); valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
valueXmlString.append( "<tran_id><![CDATA[]]></tran_id>\r\n" ); valueXmlString.append( "<tran_id><![CDATA[]]></tran_id>\r\n" );
...@@ -1615,26 +1707,64 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1615,26 +1707,64 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
allocQty = rs.getDouble("alloc_qty"); allocQty = rs.getDouble("alloc_qty");
qcSampleType = checkNullAndTrim(rs.getString("qc_sample_type")); qcSampleType = checkNullAndTrim(rs.getString("qc_sample_type"));
lineNo = getMaxLineNo(tranId, palletNo, loginSite, conn); //lineNo = getMaxLineNo(tranId, palletNo, loginSite, conn);
System.out.println("lineNo in lot_sl :::::::::::::: " + lineNo); int tmpLineNo=0;
NodeList parentList = allFormDataDom.getElementsByTagName("Detail3");
parentNodeListLength = parentList.getLength();
System.out.println((new StringBuilder("parentNodeListLength[")).append(parentNodeListLength).append("]").toString());
for (int prntCtr = 0; prntCtr < parentNodeListLength; prntCtr++)
{
parentNode1 = parentList.item(prntCtr);
AttributeMap attrMap = (AttributeMap) parentNode1.getAttributes();
System.out.println("[" + prntCtr + "] Node domID [" + attrMap.getNamedItem("domID").getLocalName() + ":" + attrMap.getNamedItem("domID").getNodeValue() + "]");
lineNo = Integer.parseInt(attrMap.getNamedItem("domID").getNodeValue());
System.out.println("lineNo----" + lineNo);
childNodeList1 = parentNode1.getChildNodes();
childNodeListLength1 = childNodeList1.getLength();
System.out.println("childNodeListLength1::: "+ childNodeListLength1+"\n");
for (int childRow = 0; childRow < childNodeListLength1; childRow++)
{
childNode1 = childNodeList1.item(childRow);
childNodeName = childNode1.getNodeName();
System.out.println("childNodeName :"+childNodeName);
if (childNodeName.equals("line_no"))
{
if(childNode1.getFirstChild()!=null)
{
lineNo = Integer.parseInt(childNode1.getFirstChild().getNodeValue().trim());
System.out.println("Detail3 lineNo:::]" +lineNo);
if(tmpLineNo<=lineNo)
{
tmpLineNo=lineNo;
}
}
}
System.out.println("childRow :"+childRow);
System.out.println("childNodeListLength1 :"+childNodeListLength1);
}
}
tmpLineNo++;
System.out.println("lineNo in lot_sl :::::::::::::: " + tmpLineNo);
if( tranId != null && tranId.trim().length() > 0 ) if( tranId != null && tranId.trim().length() > 0 )
{ {
valueXmlString.append("<Detail3 domID='"+lineNo+"' selected=\"N\">\r\n"); valueXmlString.append("<Detail3 domID='"+tmpLineNo+"' selected=\"N\">\r\n");
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n"); valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
valueXmlString.append( "<tran_id><![CDATA[" ).append( tranId ).append( "]]></tran_id>\r\n" ); valueXmlString.append( "<tran_id><![CDATA[" ).append( tranId ).append( "]]></tran_id>\r\n" );
} }
else else
{ {
valueXmlString.append("<Detail3 domID='"+lineNo+"' selected=\"N\">\r\n"); valueXmlString.append("<Detail3 domID='"+tmpLineNo+"' selected=\"N\">\r\n");
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n"); valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
valueXmlString.append( "<tran_id><![CDATA[" ).append( "" ).append( "]]></tran_id>\r\n" ); valueXmlString.append( "<tran_id><![CDATA[" ).append( "" ).append( "]]></tran_id>\r\n" );
} }
valueXmlString.append( "<line_no><![CDATA[" ).append( lineNo ).append( "]]></line_no>\r\n" ); valueXmlString.append( "<line_no><![CDATA[" ).append( tmpLineNo ).append( "]]></line_no>\r\n" );
valueXmlString.append( "<item_code><![CDATA[" ).append( itemCode ).append( "]]></item_code>\r\n" ); valueXmlString.append( "<item_code><![CDATA[" ).append( itemCode ).append( "]]></item_code>\r\n" );
valueXmlString.append( "<item_descr><![CDATA[" ).append( descr ).append( "]]></item_descr>\r\n" ); valueXmlString.append( "<item_descr><![CDATA[" ).append( descr ).append( "]]></item_descr>\r\n" );
valueXmlString.append( "<site_code><![CDATA[" ).append( loginSite ).append( "]]></site_code>\r\n" ); valueXmlString.append( "<site_code><![CDATA[" ).append( loginSite ).append( "]]></site_code>\r\n" );
......
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