Commit 382f29fe authored by msingh's avatar msingh

D15CKAT001, Changes for MS SQL Server on 07/10/2015 .


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98665 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3e253d58
......@@ -99,13 +99,17 @@ public class InvAllocTraceBean
+" and lot_no = ?"
+"and lot_sl = ? for update ";
}
//changed by manish add space before and lot_sl on 31/08/2015
else if (CommonConstants.DB_NAME.equalsIgnoreCase("MSSQL")){
sql =" select alloc_qty from stock (updlock) where item_code = ?"
+" and site_code = ?"
+" and loc_code = ?"
+" and lot_no = ?"
+"and lot_sl = ? ";
+" and lot_sl = ? ";
}
//changed by manish add space before and lot_sl on 31/08/2015
else
{
sql =" select alloc_qty from stock where item_code = ?"
......
......@@ -7,6 +7,7 @@ import java.sql.*;
import org.w3c.dom.*;
import ibase.utility.CommonConstants;
import ibase.webitm.utility.*;
import ibase.system.config.*;
import ibase.webitm.ejb.*;
......@@ -832,10 +833,25 @@ public class InvHoldIC extends ValidatorEJB implements InvHoldICLocal , InvHoldI
pStmt = conn.prepareStatement( sql );
rs = pStmt.executeQuery();
*/
// Changed by Manish on 29/09/15 for ms sql server [start]
String DB = CommonConstants.DB_NAME;
if("mssql".equalsIgnoreCase(DB))
{
sql = "select e.dept_code, d.descr dept_descr, s.descr site_descr from site s, employee e left outer join department d "
+" on e.dept_code = d.dept_code "
+" where e.emp_code = ? "
+" and s.site_code = ?" ;
}
else
{
sql = "select e.dept_code, d.descr dept_descr, s.descr site_descr from employee e, department d, site s "
+" where e.emp_code = ? "
+" and s.site_code = ?"
+" and e.dept_code = d.dept_code(+) ";
}
// Changed by Manish on 29/09/15 for ms sql server [end]
pStmt = conn.prepareStatement( sql );
pStmt.setString(1,loginEmpCode);
pStmt.setString(2,loginSiteCode);
......
......@@ -286,8 +286,9 @@ public class InvHoldRelIC extends ValidatorEJB implements InvHoldRelICLocal , In
rs = pstmt.executeQuery();
if( rs.next() )
{
siteCode1 = rs.getString(1)==null?"":rs.getString(1);
siteCode1 = rs.getString(1)==null?"":rs.getString(1).trim(); // trim() Added By Manish on 30/09/15
}
rs.close();
rs = null;
pstmt.close();
......
/*
authored by Pawan 10/7/2010 to confirm the transaction
*/
*/
package ibase.webitm.ejb.wms;
import ibase.utility.CommonConstants;
import ibase.webitm.utility.*;
import ibase.system.config.*;
import ibase.webitm.ejb.*;
......@@ -3005,6 +3006,8 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
pstmt.setString(2, pickOrder);
pstmt.setInt(3, pickLineNo);
update = pstmt.executeUpdate();
conn.commit(); //Added by manish on 29/09/15
if( update > 0 )
{
System.out.println(pickOrder+" pick_order OF PICK_ORD_DET updated successfully ");
......@@ -3328,6 +3331,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refId);
update = pstmt.executeUpdate();
conn.commit(); //Added by manish on 29/09/15
if(update > 0)
{
......@@ -4116,11 +4120,26 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
System.out.println("==> MasterCarton "+masterCarton);
PreparedStatement pstmt = null;
ResultSet rSet = null ;
//Added by Manish on 29/09/15 for ms sql server.
String DB = CommonConstants.DB_NAME;
try
{
// Changed by Manish on 29/09/15 for ms sql server.
if("mssql".equalsIgnoreCase(DB))
{
sql=" SELECT isnull(FILLER_WEIGHT,0) FILLER_WEIGHT , isnull(TARE_WEIGHT,0) TARE_WEIGHT "
+" FROM CARTON_MASTER " //Changed sql 19-SEP-14 [W14FSUN003]
+" WHERE PTCN = ? AND STATUS = ? AND ( REF_SER = ? OR REF_SER = ?) AND CARTON_NO = ? ";
}
// Changed by Manish on 29/09/15 for ms sql server.
else
{
sql=" SELECT NVL(FILLER_WEIGHT,0) FILLER_WEIGHT , NVL(TARE_WEIGHT,0) TARE_WEIGHT "
+" FROM CARTON_MASTER " //Changed sql 19-SEP-14 [W14FSUN003]
+" WHERE PTCN = ? AND STATUS = ? AND ( REF_SER = ? OR REF_SER = ?) AND CARTON_NO = ? ";
}
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,ptcn);
pstmt.setString(2,"R");
......@@ -4452,7 +4471,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
{
sql = "UPDATE WAVE_TASK_DET SET WAVE_STATUS = 'V' WHERE REF_ID = ? ";
}
// Changed by Dhanraj 10-JUL-14 It should be return V(Original).
// Changed by Dhanraj 10-JUL-14 It should be return V(Original).
/*else
{
sql = "UPDATE WAVE_TASK_DET SET WAVE_STATUS = 'W' WHERE REF_ID = ? ";
......@@ -4460,12 +4479,28 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refID);
updateCount = pstmt.executeUpdate();
//updateCount = pstmt.executeUpdate();
if(updateCount > 0)
/*Changed by Manish on 29/09/2015 for Ms Sql Server. Use result set otherwise
it gives error SQLServerException: A result set was generated for update*/
rs = pstmt.executeQuery();
// if(updateCount > 0)
// {
// System.out.println("Task Has been updated as ["+sql+"]");
// }
/*if(updateCount > 0)
{
System.out.println("Task Has been updated as ["+sql+"]");
}*/
if(rs.next())
{
System.out.println("Task Has been updated as ["+sql+"]");
}
//Changed by Manish on 29/09/2015 for Ms Sql Server [end]
else
{
System.out.println("sql Not been updated as created["+sql+"]");
......
......@@ -342,8 +342,16 @@ public class DeallocArtPrc extends ProcessEJB implements WaveGenerationPrcLocal,
" AND DESPATCH.WAVE_ID = WAVE_TASK.WAVE_ID " +
" AND DESPATCH.SORD_NO = WTD.SALE_ORDER " +
" AND DESPATCH.CONFIRMED <> 'Y' AND WAVE_TASK.CANCEL <> 'Y' " +
" AND CM.STATUS <> 'R' AND CM.CARTON_TYPE = 'S' " +
" ORDER BY WAVE_ID, PTCN, SALE_ORDER,LINE_NO__SORD, ITEM_CODE, CARTON_NO ";
" AND CM.STATUS <> 'R' AND CM.CARTON_TYPE = 'S' " ;
// " ORDER BY WAVE_ID, PTCN, SALE_ORDER,LINE_NO__SORD, ITEM_CODE, CARTON_NO ";
//changed by manish on 28/09/15 for Ms sql server databse
String DB = commonConstants.DB_NAME;
if("!mssql".equalsIgnoreCase(DB))
{
getDataSql = getDataSql + " ORDER BY WAVE_ID, PTCN, SALE_ORDER,LINE_NO__SORD, ITEM_CODE, CARTON_NO ";
}
//changed by manish on 28/09/15 for Ms sql server databse.
pstmt = conn.prepareStatement(getDataSql);
pstmt.setString(1, siteCode);
......@@ -680,6 +688,7 @@ public class DeallocArtPrc extends ProcessEJB implements WaveGenerationPrcLocal,
pstmt.setString(6, chgTerm );
if( pstmt.executeUpdate() > 0)
{
conn.commit(); //Added by manish on 29/09/15
System.out.println(" insertion in DEALLOC_ART successfully ");
}
pstmt.close();pstmt = null;
......@@ -991,6 +1000,7 @@ public class DeallocArtPrc extends ProcessEJB implements WaveGenerationPrcLocal,
pstmt.setString(15, pickType);
if( pstmt.executeUpdate() > 0 )
{
conn.commit(); //Added by manish on 29/09/15
System.out.println(" insert in DEALLOC_ART_DET succesfully done ");
}
else
......
......@@ -18,6 +18,7 @@ import org.w3c.dom.*;
import ibase.ejb.*;
import ibase.system.config.*;
import ibase.utility.BaseLogger;
import ibase.utility.CommonConstants;
import ibase.webitm.ejb.*;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.utility.GenericUtility;
......@@ -659,7 +660,7 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma
//Ended By Mahesh Patidar
}
}//outer_carton_no case
*/ }// for loop end
*/ }// for loop end
}//case 1 end
break;
case 2 : //for hdr win val....
......@@ -780,9 +781,26 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma
pickOrder = genericUtility.getColumnValue("pick_order", currDom );
System.out.println("pick order from currdom:::::"+pickOrder);
/* */
//Changed by Manish on 22/09/15 for ms sql server (as TRIM is not compataible)
String DB = CommonConstants.DB_NAME;
if("mssql".equalsIgnoreCase(DB))
{
sql = " SELECT COUNT(*) AS HOLD_QTY FROM STOCK S, PICK_ISS_HDR PH, PICK_ISS_DET PD WHERE PH.PICK_ORDER = PD.PICK_ORDER " +
" AND PD.SITE_CODE = S.SITE_CODE AND PD.ITEM_CODE = S.ITEM_CODE AND PD.LOT_NO = S.LOT_NO AND PD.LOT_SL = S.LOT_SL " +
" AND PD.LOC_CODE = S.LOC_CODE AND RTRIM(LTRIM ( S.HOLD_QTY )) > 0 AND PD.DEALLOC_QTY IS NULL AND PD.PICK_ORDER = ? " ;
}
else
{
sql = " SELECT COUNT(*) AS HOLD_QTY FROM STOCK S, PICK_ISS_HDR PH, PICK_ISS_DET PD WHERE PH.PICK_ORDER = PD.PICK_ORDER " +
" AND PD.SITE_CODE = S.SITE_CODE AND PD.ITEM_CODE = S.ITEM_CODE AND PD.LOT_NO = S.LOT_NO AND PD.LOT_SL = S.LOT_SL " +
" AND PD.LOC_CODE = S.LOC_CODE AND TRIM ( S.HOLD_QTY ) > 0 AND PD.DEALLOC_QTY IS NULL AND PD.PICK_ORDER = ? " ;
}
//Changed by Manish on 22/09/15 for ms sql server for TRIM [end]
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, pickOrder);
rs = pstmt.executeQuery();
......
......@@ -5,6 +5,7 @@
package ibase.webitm.ejb.wms;
import ibase.utility.CommonConstants;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.GenericUtility;
......@@ -110,9 +111,23 @@ public class MultiPickWizPrs extends ValidatorEJB implements MultiPickWizPrsLoca
if(ptcnList != null && ptcnList.size() > 0)
{
//Changed by Manish on 10/09/2015 for mssql database [START]
String DB = CommonConstants.DB_NAME;
if("mssql".equalsIgnoreCase(DB))
{
sql = "select count(*) from pack_det where RTRIM(LTRIM(carton_no)) in "
+ "(select RTRIM(LTRIM(carton_no)) from carton_master where ptcn = ?)";
}
else
{
sql = "select count(*) from pack_det where trim(carton_no) in "
+ "(select trim(carton_no) from carton_master where ptcn = ?)";
}
//Changed by Manish on 10/09/2015 for mssql database [END]
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, ptcnList.get(0));
......
......@@ -994,6 +994,12 @@ public class PoRcpIC extends ValidatorEJB implements PoRcpICRemote, PoRcpICLocal
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
// Changed by Manish on 29/07/15 (for trim loc_type)
locTypeItem = locTypeItem == null ? "" : locTypeItem.trim();
locTypeLocation = locTypeLocation == null ? "" : locTypeLocation.trim();
// Changed by Manish on 29/07/15
if( !locTypeLocation.equalsIgnoreCase(locTypeItem) )
{
errList.add( "VMLOCTYP1" );
......@@ -2150,7 +2156,9 @@ public class PoRcpIC extends ValidatorEJB implements PoRcpICRemote, PoRcpICLocal
valueXmlString.append( "<vouch_created><![CDATA[" ).append( checkNull(rs.getString("VOUCH_CREATED")) ).append( "]]></vouch_created>\r\n" );
valueXmlString.append( "<lr_no><![CDATA[" ).append( checkNull(rs.getString("LR_NO")) ).append( "]]></lr_no>\r\n" );
valueXmlString.append( "<lorry_no><![CDATA[" ).append( checkNull(rs.getString("LORRY_NO")) ).append( "]]></lorry_no>\r\n" );
valueXmlString.append( "<trans_mode><![CDATA[" ).append( transMode ).append( "]]></trans_mode>\r\n" );
//Added by manish on 27/07/15 (add checknull for trans_mode)
valueXmlString.append( "<trans_mode><![CDATA[" ).append( checkNull(transMode) ).append( "]]></trans_mode>\r\n" );
valueXmlString.append( "<item_ser><![CDATA[" ).append( checkNull(rs.getString("ITEM_SER")) ).append( "]]></item_ser>\r\n" );
//valueXmlString.append( "<frt_amt><![CDATA[" ).append( checkNull(rs.getString("FRT_AMT")) ).append( "]]></frt_amt>\r\n" );//Commented By Mahesh Patidar on 29/06/12
valueXmlString.append( "<frt_amt><![CDATA[0]]></frt_amt>\r\n" );//Added By Mahesh Patidar on 29/06/12
......@@ -2412,7 +2420,9 @@ public class PoRcpIC extends ValidatorEJB implements PoRcpICRemote, PoRcpICLocal
/* Added By Ashish Sonawane on 28/08/12 as per manoharan Sir [START] */
valueXmlString.append( "<frt_amt><![CDATA[0]]></frt_amt>\r\n" );
valueXmlString.append( "<insurance_amt><![CDATA[0]]></insurance_amt>\r\n" );
valueXmlString.append( "<trans_mode><![CDATA[" ).append( transMode ).append( "]]></trans_mode>\r\n" );
//Added by manish on 27/07/15 (add checknull for trans_mode)
valueXmlString.append( "<trans_mode><![CDATA[" ).append( checkNull(transMode) ).append( "]]></trans_mode>\r\n" );
valueXmlString.append( "<accept_criteria><![CDATA[" ).append( accptCriteria ).append( "]]></accept_criteria>\r\n" );
valueXmlString.append( "<reciept_type><![CDATA[" ).append( "F" ).append( "]]></reciept_type>\r\n" );
/* Added By Ashish Sonawane on 28/08/12 as per manoharan Sir [END] */
......
......@@ -25,6 +25,7 @@ import javax.ejb.*;
import javax.naming.InitialContext;
import ibase.system.config.*;
import ibase.utility.CommonConstants;
import ibase.webitm.ejb.*;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.utility.GenericUtility;
......@@ -36,6 +37,10 @@ public class ReplIssIC extends ValidatorEJB implements ReplIssICLocal, ReplIssIC
/**
* The method is defined without any parameter and returns blank string
*/
//Added by Manish on 16/09/2015 for Ms Sql Server.
String DB = CommonConstants.DB_NAME;
public String wfValData() throws RemoteException, ITMException
{
return "";
......@@ -516,7 +521,7 @@ public class ReplIssIC extends ValidatorEJB implements ReplIssICLocal, ReplIssIC
}
//Changed by Rohan on 06-09-12 to check previous task finish or not.end
*/
*/
// cpatil start on 11-sept-12
......@@ -525,9 +530,25 @@ public class ReplIssIC extends ValidatorEJB implements ReplIssICLocal, ReplIssIC
//Changed By Pragyan 08-May-14 to check the cancel mode for hold stocks
/*sql = " select count (*) from stock where (item_code, site_code, loc_code, lot_no, lot_sl ) in " +
" ( select item_code, site_code, loc_code, lot_no, lot_sl from repl_ord_det where repl_order = ? ) and ( hold_qty > 0 ) ";*/
//Changed by Manish on 16/09/2015 for MS Sql Server
String DB = CommonConstants.DB_NAME;
if("mssql".equalsIgnoreCase(DB))
{
sql = " select count (*) from stock inner join " +
" ( select item_code, site_code, loc_code, lot_no, lot_sl from repl_ord_det where repl_order = ? " +
" and case when cancel_mode is null then 'N' else cancel_mode end <> 'Y') A on stock.item_code=A.item_code "+
" and stock.site_code = A.SITE_CODE and Stock.loc_code =A.LOC_CODE and stock.lot_no =A.LOT_NO and STOCK.LOT_SL =A.LOT_SL " +
" and ( hold_qty > 0 )";
}
else
{
sql = " select count (*) from stock where (item_code, site_code, loc_code, lot_no, lot_sl ) in " +
" ( select item_code, site_code, loc_code, lot_no, lot_sl from repl_ord_det where repl_order = ? " +
" and case when cancel_mode is null then 'N' else cancel_mode end <> 'Y') and ( hold_qty > 0 )";
}
//Changed by Manish on 16/09/2015 for MS Sql Server
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,replOrder);
rs = pstmt.executeQuery();
......@@ -679,8 +700,15 @@ public class ReplIssIC extends ValidatorEJB implements ReplIssICLocal, ReplIssIC
sql = " SELECT R.REPL_ORDER,R.ORDER_TYPE FROM REPL_ORD_HDR R, WAVE_TASK W, WAVE_TASK_DET WD, REPL_ORD_DET RT WHERE " +
" R.REPL_ORDER = WD.REF_ID AND R.REPL_ORDER = RT.REPL_ORDER AND R.WAVE_ID = W.WAVE_ID AND W.WAVE_ID = WD.WAVE_ID " +
" AND WD.STATUS ='N' AND W.CANCEL = 'N' AND ( RT.CANCEL_MODE='N' OR RT.CANCEL_MODE IS NULL ) " +
" AND RT.SITE_CODE = ? AND RT.ITEM_CODE = ? AND RT.LOC_CODE = ? AND RT.LOT_NO = ? AND RT.LOT_SL = ? " +
" ORDER BY REPL_ORDER ";
" AND RT.SITE_CODE = ? AND RT.ITEM_CODE = ? AND RT.LOC_CODE = ? AND RT.LOT_NO = ? AND RT.LOT_SL = ? " ;
//changed by manish on 16/09/15 for Ms sql server databse.[start]
if("!mssql".equalsIgnoreCase(DB))
{
sql = sql + " ORDER BY REPL_ORDER ";
}
//changed by manish on 16/09/15 for Ms sql server databse.[end]
pstmt = conn.prepareStatement( sql );
pstmt.setString( 1, siteCode );
pstmt.setString( 2, itemCode );
......@@ -3678,7 +3706,7 @@ public class ReplIssIC extends ValidatorEJB implements ReplIssICLocal, ReplIssIC
//" AND FN_VALID_REPL(H.REPL_ORDER) = 'Y' " +
" AND R.LOC_CODE = L.LOC_CODE AND L.INV_STAT = ? AND (H.ASSIGN_TO = ? OR H.ASSIGN_TO IS NULL) " +
//" AND FN_CHECK_REPL_ORD_USER(H.REPL_ORDER,?) = 1
" ) "+
" ) A "+ //Added A before order on 16/09/15 by manish for mssql
//End Changed by Dhanraj 11-Aug-14 this condition call by java function's.
"ORDER BY ASSIGN_TO,REPL_ORDER,LOC_CODE ";
}
......@@ -3704,7 +3732,7 @@ public class ReplIssIC extends ValidatorEJB implements ReplIssICLocal, ReplIssIC
//" AND FN_VALID_REPL(H.REPL_ORDER) = 'Y' " +
" AND R.LOC_CODE = L.LOC_CODE AND L.INV_STAT = ? AND (H.ASSIGN_TO = ? OR H.ASSIGN_TO IS NULL) " +
//" AND FN_CHECK_REPL_ORD_USER(H.REPL_ORDER,?) = 1
" ) "+
" ) A "+ //Added A before order on 16/09/15 by manish for mssql
//End Changed by Dhanraj 11-Aug-14 this condition call by java function's.
" ORDER BY ASSIGN_TO,REPL_ORDER,LOC_CODE ";
}
......@@ -3812,7 +3840,7 @@ public class ReplIssIC extends ValidatorEJB implements ReplIssICLocal, ReplIssIC
//" AND FN_VALID_REPL(H.REPL_ORDER) = 'Y' " +
" AND R.LOC_CODE = L.LOC_CODE AND (H.ASSIGN_TO = ? OR H.ASSIGN_TO IS NULL) " +
//" AND FN_CHECK_REPL_ORD_USER(H.REPL_ORDER,?) = 1
" ) "+
" ) A "+ //Added A before order on 16/09/15 by manish for mssql
" ORDER BY ASSIGN_TO,REPL_ORDER,LOC_CODE ";
//End Changed by Dhanraj 11-Aug-14 this condition call by java function's.
//changed by sankara on 28-11-13 for set repl order itm default end.
......@@ -3835,7 +3863,7 @@ public class ReplIssIC extends ValidatorEJB implements ReplIssICLocal, ReplIssIC
//" AND FN_VALID_REPL(H.REPL_ORDER) = 'Y' " +
" AND R.LOC_CODE = L.LOC_CODE AND (H.ASSIGN_TO = ? OR H.ASSIGN_TO IS NULL) " +
//" AND FN_CHECK_REPL_ORD_USER(H.REPL_ORDER,?) = 1
" ) "+
" ) A "+ //Added A before order on 16/09/15 by manish for mssql
//End Changed by Dhanraj 11-Aug-14 this condition call by java function's.
" ORDER BY ASSIGN_TO,REPL_ORDER,LOC_CODE ";
//changed by sankara on 28-11-13 for set repl order itm default end.
......@@ -4085,7 +4113,7 @@ public class ReplIssIC extends ValidatorEJB implements ReplIssICLocal, ReplIssIC
//Changed By Pragyan 15-sep-12 To add Carton No
valueXmlString.append( "<carton_no><![CDATA[" ).append( cartonNo ).append( "]]></carton_no>\r\n" );
System.out.println(" 07/07/14 carton_no_org IN CASE 2===>"+cartonNo);
// Changed By Dhanraj 11-JUL-14 To add Carton No org.
// Changed By Dhanraj 11-JUL-14 To add Carton No org.
valueXmlString.append( "<carton_no_org><![CDATA[" ).append( cartonNo ).append( "]]></carton_no_org>\r\n" );
//End changes by gulzar on 01/12/11
}
......@@ -4455,6 +4483,20 @@ public class ReplIssIC extends ValidatorEJB implements ReplIssICLocal, ReplIssIC
"AND REPL_ORD_DET.SITE_CODE = SITE.SITE_CODE(+) ";
pstmt = conn.prepareStatement( sql );
}*/
//changed by manish on 16/09/15 for Ms sql server databse [start]
if("mssql".equalsIgnoreCase(DB))
{
sql = " SELECT ROD.ITEM_CODE, ROD.SITE_CODE, ROD.LOC_CODE, ROD.LOT_NO, ROD.LOT_SL, I.DESCR AS ITEM_DESCR , I.UNIT, S.DESCR AS SITE_DESCR , " +
" ROD.LOC_CODE__TO , SUM(QUANTITY) AS QUANTITY , SUM(NO_ART) AS NO_ART FROM ITEM I , SITE S, REPL_ORD_DET ROD " +
" left join (SELECT REPL_ORDER, LINE_NO__ORD FROM REPL_ISS_DET WHERE REPL_ORDER = ? ) a on ROD.REPL_ORDER = a.REPL_ORDER and ROD.LINE_NO = a.LINE_NO__ORD " +
" WHERE ROD.REPL_ORDER = ? AND ROD.ITEM_CODE = I.ITEM_CODE AND ROD.SITE_CODE = S.SITE_CODE " +
" AND CASE WHEN ROD.CANCEL_MODE IS NULL THEN 'N' ELSE ROD.CANCEL_MODE END <> 'Y' " +
" GROUP BY ROD.ITEM_CODE,ROD.SITE_CODE, ROD.LOC_CODE, ROD.LOT_NO, ROD.LOT_SL, I.DESCR , I.UNIT, S.DESCR , ROD.LOC_CODE__TO " +
" ORDER BY ROD.LOC_CODE ";
}
else
{
sql = " SELECT ROD.ITEM_CODE, ROD.SITE_CODE, ROD.LOC_CODE, ROD.LOT_NO, ROD.LOT_SL, I.DESCR AS ITEM_DESCR , I.UNIT, S.DESCR AS SITE_DESCR , " +
" ROD.LOC_CODE__TO , SUM(QUANTITY) AS QUANTITY , SUM(NO_ART) AS NO_ART FROM REPL_ORD_DET ROD, ITEM I , SITE S " +
" WHERE ROD.REPL_ORDER = ? AND ROD.ITEM_CODE = I.ITEM_CODE AND ROD.SITE_CODE = S.SITE_CODE " +
......@@ -4463,6 +4505,8 @@ public class ReplIssIC extends ValidatorEJB implements ReplIssICLocal, ReplIssIC
" GROUP BY ROD.ITEM_CODE,ROD.SITE_CODE, ROD.LOC_CODE, ROD.LOT_NO, ROD.LOT_SL, I.DESCR , I.UNIT, S.DESCR , ROD.LOC_CODE__TO " +
//Changed by sumit on 22/05/13 ordering loc_code.
" ORDER BY ROD.LOC_CODE ";
}
//changed by manish on 16/09/15 for Ms sql server databse [end]
pstmt = conn.prepareStatement(sql);
replLine = "SELECT LINE_NO FROM REPL_ORD_DET WHERE ITEM_CODE = ? AND SITE_CODE = ? AND LOC_CODE = ? AND LOT_NO = ?" +
......@@ -4911,8 +4955,17 @@ public class ReplIssIC extends ValidatorEJB implements ReplIssICLocal, ReplIssIC
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
//changed by manish on 16/09/15 for Ms sql server databse [start]
if("mssql".equalsIgnoreCase(DB))
{
sql="SELECT dbo.FN_CHECK_REPL_ORD_USER( ? , ? ) as isPresent ";
}
else
{
sql="SELECT FN_CHECK_REPL_ORD_USER( ? , ? ) as isPresent from DUAL";
}
//changed by manish on 16/09/15 for Ms sql server databse [end]
pstmt = connObject.prepareStatement( sql );
pstmt.setString( 1, replOrder );
pstmt.setString( 2, logingCode );
......
......@@ -3732,7 +3732,18 @@ public class ShipmentConf extends ActionHandlerEJB implements ShipmentConfLocal,
//valueXmlString.append( "<lr_no><![CDATA[" ).append( getSSCC(prefix, pronoLast, conn) ).append( "]]></lr_no>\r\n" ); // added to generate SSCC18 complaint number //commented as per suggestion
sProno = ("" + pronoLast).trim();
System.out.println("manohar before prefix["+prefix+"]::::sProno["+sProno+"]");
//Changed by Manish on 25/09/2015 for ms sql server.[start]
String DB = CommonConstants.DB_NAME;
if("mssql".equalsIgnoreCase(DB))
{
sql = "SELECT dbo.fn_prono(?, ?)";
}
//Changed by Manish on 25/09/2015 for ms sql server.[end]
else
{
sql = "SELECT fn_prono(?,to_char(?)) FROM dual";
}
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranCode);
pstmt.setString(2, sProno);
......@@ -3800,7 +3811,18 @@ public class ShipmentConf extends ActionHandlerEJB implements ShipmentConfLocal,
{
lrNo = getLrNo(xtraParams,conn);
System.out.println("manohar before lr_no ["+lrNo+"]");
//Changed by Manish on 25/09/2015 for ms sql server.[start]
if("mssql".equalsIgnoreCase(DB))
{
sql = "SELECT dbo.fn_prono(?, ?)";
}
//Changed by Manish on 25/09/2015 for ms sql server.[end]
else
{
sql = "SELECT fn_prono(?,to_char(?)) FROM dual";
}
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranCode);
pstmt.setString(2, lrNo);
......
......@@ -2951,6 +2951,13 @@ private String checkNull( String input )
{
input = "";
}
//Changed By Manish for trim value on 23/09/15 [start]
else
{
input = input.trim();
}
//Changed By Manish for trim value on 23/09/15 [end]
return input;
}
// 02/08/12 manoharan following method added to generate SSCC18 complaint number
......
/**
* PURPOSE : Validation and Item Change implementation for Stock Transfer component .
* AUTHOR : Gulzar
* Date : 24/10/11
*
*/
* PURPOSE : Validation and Item Change implementation for Stock Transfer component .
* AUTHOR : Gulzar
* Date : 24/10/11
*
*/
package ibase.webitm.ejb.wms;
......@@ -22,6 +22,7 @@ import org.w3c.dom.*;
import ibase.ejb.*;
import ibase.system.config.*;
import ibase.utility.BaseLogger;
import ibase.utility.CommonConstants;
import ibase.webitm.ejb.*;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.utility.GenericUtility;
......@@ -586,7 +587,7 @@ public class StockTransferGrlIC extends ValidatorEJB implements StockTransferGrl
rs.close(); rs = null;
pstmt.close(); pstmt = null;
// if ( !invStat.trim().equalsIgnoreCase(resrvLocInvstat.trim()) )
// if ( !invStat.trim().equalsIgnoreCase(resrvLocInvstat.trim()) )
if(!(invStatList.contains(invStat.trim())))//Changed By Mahesh Patidar on 23/06/12
{
errList.add( "VTLOCCODE8" );
......@@ -2037,6 +2038,22 @@ public class StockTransferGrlIC extends ValidatorEJB implements StockTransferGrl
+ " HAVING SUM (CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END) > 0) "
+ " ORDER BY ABS(A.LOC_ZONE - ?),A.LOC_CODE ) WHERE LOC_CHECK_COUNT > 0 AND ROWNUM < 5" ;*/
String DB = CommonConstants.DB_NAME;
System.out.println("DB=====>>>"+DB);
//changed by manish on 10/08/2015 for MS SQL SERVER database (replace nvl and add isnull in sql query)
if("mssql".equalsIgnoreCase(DB))
{
sql = "SELECT A.LOC_CODE, A.LOC_ZONE, A.LOC_TYPE FROM LOCATION A ,INVSTAT B ,SITE S WHERE A.INV_STAT = B.INV_STAT AND B.AVAILABLE = 'Y' " +
"AND A.LOC_TYPE = ? AND S.SITE_CODE = ? AND (S.FACILITY_CODE = A.FACILITY_CODE or isnull(s.facility_code ,'N') = 'N') " +
"AND A.INV_STAT IN ("+invStstPars+") AND (CASE WHEN B.STAT_TYPE IS NULL THEN ' ' ELSE B.STAT_TYPE END) <> 'S' "+
"and isnull((SELECT sum(quantity) FROM STOCK WHERE SITE_CODE = ? AND stock.loc_code = a.loc_code),0) = 0 " +
"ORDER BY ABS(A.LOC_ZONE - ? ),A.LOC_CODE" ;
}
//changed by manish on 10/08/2015 for MS SQL SERVER database
else
{
sql = " SELECT A.LOC_CODE, A.LOC_ZONE, A.LOC_TYPE FROM LOCATION A ,INVSTAT B ,SITE S WHERE A.INV_STAT = B.INV_STAT AND B.AVAILABLE = 'Y' " +
" AND A.LOC_TYPE = ? AND S.SITE_CODE = ? AND (S.FACILITY_CODE = A.FACILITY_CODE or nvl(s.facility_code ,'N') = 'N') " +
" AND A.INV_STAT IN ("+invStstPars+") AND (CASE WHEN B.STAT_TYPE IS NULL THEN ' ' ELSE B.STAT_TYPE END) <> 'S' " +
......@@ -2045,7 +2062,7 @@ public class StockTransferGrlIC extends ValidatorEJB implements StockTransferGrl
" and nvl((SELECT sum(quantity) FROM STOCK WHERE SITE_CODE = ? AND stock.loc_code = a.loc_code),0) = 0 " +
" AND ROWNUM < 5 "+
" ORDER BY ABS(A.LOC_ZONE - ? ),A.LOC_CODE ";
}
// Changed by sankara on 27/08/13 for optimized the sql end.
pstmt = conn.prepareStatement(sql);
......
/**
* PURPOSE : Validation and Item Change implementation for Stock Transfer component .
* AUTHOR : BALU
* Date : 19/09/2011
*
*/
* PURPOSE : Validation and Item Change implementation for Stock Transfer component .
* AUTHOR : BALU
* Date : 19/09/2011
*
*/
package ibase.webitm.ejb.wms;
......@@ -21,6 +21,7 @@ import org.w3c.dom.*;
import ibase.ejb.*;
import ibase.system.config.*;
import ibase.utility.BaseLogger;
import ibase.utility.CommonConstants;
import ibase.webitm.ejb.*;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.utility.GenericUtility;
......@@ -532,8 +533,20 @@ public class StockTransferIC extends ValidatorEJB implements StockTransferICRemo
}
//Changed By Pragyan 11-AUG-14 To check and Facility Master implementation.end
// Changed by Manish on 21/09/15 for Ms Sql Server [start]
String DB = CommonConstants.DB_NAME;
if("mssql".equalsIgnoreCase(DB))
{
sql ="SELECT COUNT(*) AS LOCCOUNT FROM STOCK WHERE ITEM_CODE = ? AND SITE_CODE = ? AND LOC_CODE = ? " +
" AND LOT_NO = ? AND LOT_SL = ? AND EXP_DATE <= getdate()";
}
// Changed by Manish on 21/09/15 for Ms Sql Server[End]
else
{
sql ="SELECT COUNT(*) AS LOCCOUNT FROM STOCK WHERE ITEM_CODE = ? AND SITE_CODE = ? AND LOC_CODE = ? " +
" AND LOT_NO = ? AND LOT_SL = ? AND EXP_DATE <= fn_sysdate()";
}
pstmt = conn.prepareStatement( sql );
pstmt.setString( 1, itemCode );
pstmt.setString( 2, siteCode );
......
package ibase.webitm.utility.wms;
import ibase.utility.CommonConstants;
import ibase.webitm.utility.ITMException;
import java.sql.Connection;
......@@ -26,9 +27,21 @@ public class CommonWmsUtil {
double packSize=0.0;
boolean isValidLocation = false;
int count = 0;
// Added By Manish on 27/07/15
String sql = "";
String DB = CommonConstants.DB_NAME;
System.out.println("DB=====>>>"+DB);
try {
String sql ="SELECT FN_CHECK_VALID_LOC(?,?) FROM DUAL";
//changed by manish for database MS SQL server on 27/07/15
if("mssql".equalsIgnoreCase(DB))
{
sql ="SELECT dbo.FN_CHECK_VALID_LOC(?,?)";
}
else
{
sql ="SELECT FN_CHECK_VALID_LOC(?,?) FROM DUAL";
}
pstmt =conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setString(2, locCode);
......
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