Commit fe180be2 authored by rbhogale's avatar rbhogale

Change by Rohan on 20-02-13 for not cancle repanishment if repanishment is alredy scan


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92721 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ce29b3bf
......@@ -1142,6 +1142,11 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
ResultSet rs2 = null;
boolean isDepRepl = false;
//Changed by Rohan on 22-01-13 to cancle independent Repanishment.end
//Changed by Rohan on 18-02-13 for checking repanishment confirm.start
String sqlReplConf = "";
String replOrd1 = "";
String replLine1 ="";
//Changed by Rohan on 18-02-13 for checking repanishment confirm.end
DistCommon discommon = new DistCommon();
String casePickLoc = discommon.getDisparams("999999","CASE_PICK_INVSTAT",conn);
String activePickLoc = discommon.getDisparams("999999","ACTIVE_PICK_INVSTAT",conn);
......@@ -1150,11 +1155,10 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
double actQty = 0d;
int count = 0;
try
{
System.out.println("replOrdOrg===---->"+replOrdOrg+"replLineOrg%%%%"+replLineOrg);
System.out.println("replOrdOrg::::::"+replOrdOrg+"replLineOrg:::::"+replLineOrg);
//Changed by Rohan on 22-01-13 to cancle independent Repanishment.start
//to check case to active Repanishment.start
......@@ -1177,76 +1181,73 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
rs2.close();
rs2 = null;
}
/*
System.out.println("replType&*&*"+replType);
//if("Q".equalsIgnoreCase(replType) || "J".equalsIgnoreCase(replType) || "C".equalsIgnoreCase(replType) || "K".equalsIgnoreCase(replType) || "M".equalsIgnoreCase(replType))
if("Q".equalsIgnoreCase(replType) || "C".equalsIgnoreCase(replType) || "K".equalsIgnoreCase(replType) || "M".equalsIgnoreCase(replType))
{
if("Q".equalsIgnoreCase(replType) )
{
sqlDep = "SELECT PICK_ORDER FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ?";
}
else if("C".equalsIgnoreCase(replType) || "M".equalsIgnoreCase(replType) || "K".equalsIgnoreCase(replType))
System.out.println("repl type:::"+replType);
//Changed by Rohan on 18-02-13 for checking repanishment confirm.start
sqlReplConf = "SELECT COUNT(*) AS COUNT FROM REPL_ISS_DET WHERE REPL_ORDER = ? AND LINE_NO__ORD = ?";
pstmt2 = conn.prepareStatement(sqlReplConf);
sql = "SELECT PICK_ORDER,LINE_NO__PICK FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ? ";
pstmt1 = conn.prepareStatement(sql);
replOrd1 = replOrdOrg;
replLine1 = replLineOrg;
do
{
sqlDep = "SELECT REPL_ORDER FROM REPL_ORD_DET WHERE PICK_ORDER = ? AND LINE_NO__PICK = ? ";
}
pstmt2 = conn.prepareStatement(sqlDep);
pstmt2.setString(1, replOrdOrg);
pstmt2.setString(2, replLineOrg);
pstmt2.setString(1, replOrd1);
pstmt2.setString(2, replLine1);
rs2 = pstmt2.executeQuery();
if(rs2.next())
{
ordRepl = rs2.getString(1);
}
if(pstmt2 != null)
{
pstmt2.close();
pstmt2 = null;
cnt = rs2.getInt("COUNT");
}
if(rs2 != null)
if(cnt > 0)
{
rs2.close();
rs2 = null;
isDepRepl = true;
break;
}
//sqlWave = "SELECT H.WAVE_ID FROM WAVE_TASK_DET D,WAVE_TASK H "
// + " WHERE D.REF_ID = ? AND D.WAVE_ID = H.WAVE_ID AND H.CANCEL <> 'Y'";
sqlWave = "SELECT WAVE_ID FROM WAVE_TASK_DET WHERE REF_ID = ?";
pstmt1 = conn.prepareStatement(sqlWave);
pstmt1.setString(1, ordRepl);
System.out.println("ordRepl===>"+ ordRepl);
//to check dso-pnd repanishment exist.start
pstmt1.setString(1, replOrd1);
pstmt1.setString(2, replLine1);
rs1 = pstmt1.executeQuery();
replOrd1 = "";
replLine1 = "";
if(rs1.next())
{
waveIDCmp = rs1.getString("WAVE_ID");
System.out.println("waveIDCmp::::::"+waveIDCmp+"Wave ID:::"+waveID);
replOrd1 = checkNull(rs1.getString("PICK_ORDER"));
replLine1 = rs1.getString("LINE_NO__PICK");
}
if(!waveIDCmp.trim().equalsIgnoreCase(waveID.trim()) && !"".equalsIgnoreCase(waveIDCmp))
{
System.out.println("NOT EQUALSS:::::::::");
isDepRepl = true;
//to check dso-pnd repanishment exist.end
pstmt1.clearParameters();
pstmt2.clearParameters();
}
while(!"".equalsIgnoreCase(replOrd1));
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if(pstmt2 != null)
{
pstmt2.close();
pstmt2 = null;
}
if(rs2 != null)
{
rs2.close();
rs2 = null;
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
}
*/
//to check case to active Repanishment.start
//if(!"Q".equalsIgnoreCase(replType) && "J".equalsIgnoreCase(replType))
//else
//{
System.out.println("repl type***"+replType);
//Changed by Rohan on 18-02-13 for checking repanishment confirm.end
//to check PICK wave id and reference Repanishment WAVE_ID different.start
//sqlWave = "SELECT WAVE_ID FROM WAVE_TASK_DET WHERE REF_ID = ? ";
sqlWave = " SELECT D.WAVE_ID FROM WAVE_TASK_DET D,WAVE_TASK H WHERE D.REF_ID = ? "
......@@ -1257,7 +1258,6 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
while(rs1.next())
{
waveIDCmp = rs1.getString("WAVE_ID");
System.out.println("waveIDCmp1111"+waveIDCmp+"Wave ID111"+waveID);
if(!waveIDCmp.trim().equalsIgnoreCase(waveID.trim()) && !"".equalsIgnoreCase(waveIDCmp))
{
isDepRepl = true;
......@@ -1267,7 +1267,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
//to check PICK wave id and reference Repanishment WAVE_ID different.end
if(!isDepRepl)
{
System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
/*
if("Q".equalsIgnoreCase(replType))
{
......@@ -1284,7 +1284,6 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
if(!"Q".equalsIgnoreCase(replType))
{
System.out.println("NOT QQQQQ");
//if dso-pnd,pnd-caspk repl dependent two pick in two wave IDS
sqlDep1 = "SELECT PICK_ORDER,LINE_NO FROM PICK_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO__REPL = ? AND PICK_ORDER <> ? ";
}
......@@ -1303,7 +1302,6 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
//ordRepl = rs2.getString(1);
replOrdDep = checkNull(rs2.getString("REPL_ORDER"));
replOrdDepLine = checkNull(rs2.getString("LINE_NO"));
System.out.println("replOrdDep"+replOrdDep+"replOrdDepLine"+replOrdDepLine);
}
if(pstmt2 != null)
......@@ -1319,7 +1317,6 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
if("".equalsIgnoreCase(replOrdDep) && !"Q".equalsIgnoreCase(replType))
{
System.out.println("111111111111111111111111111111111");
pstmt2 = conn.prepareStatement(sqlDep1);
pstmt2.setString(1, replOrdOrg);
pstmt2.setString(2, replLineOrg);
......@@ -1333,66 +1330,27 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
replOrdDepLine = checkNull(rs2.getString("LINE_NO"));
}
}
/*
sqlPick = "SELECT PICK_ORDER FROM PICK_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO__REPL = ? AND PICK_ORDER <> ?";
pstmt = conn.prepareStatement(sqlPick);
if(!"".equalsIgnoreCase(replOrdDep))
{
pstmt.setString(1, replOrdDep);
pstmt.setString(2, replOrdDepLine);
}
else
{
pstmt.setString(1, replOrdOrg);
pstmt.setString(2, replLineOrg);
}
pstmt.setString(3, pickOrder);
rs = pstmt.executeQuery();
while(rs.next())
{
//sqlWave = "SELECT WAVE_ID FROM WAVE_TASK_DET WHERE REF_ID = ?";
//sqlWave = "SELECT H.WAVE_ID FROM WAVE_TASK_DET D,WAVE_TASK H "
// + " WHERE D.REF_ID = ? AND D.WAVE_ID = H.WAVE_ID AND H.CANCEL <> 'Y'";
//pstmt1 = conn.prepareStatement(sqlWave);
*/
pstmt1.clearParameters();
waveIDCmp = "";
if(!"".equalsIgnoreCase(replOrdDep) && replOrdDep.trim().length() > 0)
{
pstmt1.setString(1, replOrdDep);
System.out.println("replOrdDep ORDRDRD====>"+ replOrdDep);
rs1 = pstmt1.executeQuery();
while(rs1.next())
{
waveIDCmp = rs1.getString("WAVE_ID");
System.out.println("waveIDCmp"+waveIDCmp+"Wave ID"+waveID);
if(!waveIDCmp.trim().equalsIgnoreCase(waveID.trim()) && !"".equalsIgnoreCase(waveIDCmp))
{
System.out.println("NOT EQUALSS");
isDepRepl = true;
break;
}
}
}
/*if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if(rs != null)
{
rs.close();
rs = null;
}*/
if(rs1 != null)
{
rs1.close();
......@@ -1402,7 +1360,6 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
if(isDepRepl)
{
//Changed by Rohan on 22-01-13 to cancle independent Repanishment.end
System.out.println("#############################################");
if(confirm)
{
//if(!"C".equalsIgnoreCase(orderType))
......@@ -1416,7 +1373,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
if(rs.next())
{
orderType = rs.getString("ORDER_TYPE");
System.out.println("Order type___"+orderType);
System.out.println("Order type:::"+orderType);
if(!"C".equalsIgnoreCase(orderType) && !"K".equalsIgnoreCase(orderType.trim()) && !"J".equalsIgnoreCase(orderType.trim()) && !"M".equalsIgnoreCase(orderType.trim()))
{
if(!"Q".equalsIgnoreCase(orderType))
......@@ -1589,7 +1546,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
}
else
{
System.out.println("Enter in else Repanishment)*)*()*");
sql= "UPDATE REPL_ORD_DET SET ACTUAL_QTY = 0,CANCEL_MODE = 'Y'" +
" WHERE REPL_ORDER = ? AND LINE_NO = ?" ;
pstmt = conn.prepareStatement(sql);
......@@ -1726,7 +1683,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
pstmt1 = null;
}
System.out.println("invStat LOCATION_______"+invStat);
System.out.println("invStat LOCATION:::"+invStat);
if(invStat.trim().equalsIgnoreCase(activePickLoc))
{
System.out.println("Original hashmap"+replHashMap.toString());
......
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