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