Commit e6b10a18 authored by rbhogale's avatar rbhogale

Changed by Rohan on 04-03-13 for Wave Cancelation dependet repl cheack


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92795 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 177d8c87
......@@ -1125,10 +1125,10 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
String ordRepl = "";
//Changed by Rohan on 22-01-13 to cancle independent Repanishment.start
String sqlPick ="";
String sqlWave ="";
String sqlReplWave ="";
String waveIDCmp = "";
String sqlAct ="";
String sqlDep ="";
String sqlPickWave ="";
String replType = "";
//Changed by Rohan on 07-02-13 for define variables.strat
String replOrdDep = "";
......@@ -1248,128 +1248,69 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
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
//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 = ? "
+" AND D.WAVE_ID = H.WAVE_ID AND CASE WHEN CANCEL IS NULL THEN 'N' ELSE CANCEL END <> 'Y' ";
pstmt1 = conn.prepareStatement(sqlWave);
//Changed by Rohan on 04-03-13 for check Depended repanishment.start
sqlReplWave = " SELECT W.WAVE_ID FROM PICK_ORD_HDR H , PICK_ORD_DET D ,WAVE_TASK W,WAVE_TASK_DET T "
+ " WHERE H.PICK_ORDER = D.PICK_ORDER AND D.REPL_ORDER = ? AND LINE_NO__REPL = ? "
+ " AND W.CANCEL <> 'Y' AND T.WAVE_ID = W.WAVE_ID AND H.WAVE_ID = W.WAVE_ID AND "
+ " T.REF_ID = H.PICK_ORDER AND W.WAVE_ID <> ? ";
pstmt1 = conn.prepareStatement(sqlReplWave);
pstmt1.setString(1,replOrdOrg);
pstmt1.setString(2,replLineOrg);
pstmt1.setString(3,waveID);
rs1 = pstmt1.executeQuery();
while(rs1.next())
if(rs1.next())
{
waveIDCmp = rs1.getString("WAVE_ID");
if(!waveIDCmp.trim().equalsIgnoreCase(waveID.trim()) && !"".equalsIgnoreCase(waveIDCmp))
{
isDepRepl = true;
break;
}
System.out.println(" :::::Pick Depended :::::::");
isDepRepl = true;
}
//to check PICK wave id and reference Repanishment WAVE_ID different.end
//Changed by Rohan on 21-02-13 for checkig
if(!isDepRepl)
else
{
/*
if("Q".equalsIgnoreCase(replType))
{
sqlDep = "SELECT PICK_ORDER,LINE_NO__PICK FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ?";
}
else
{
sqlDep = "SELECT REPL_ORDER,LINE_NO FROM REPL_ORD_DET WHERE PICK_ORDER = ? AND LINE_NO__PICK = ? ";
}
*/
sqlPickWave = "SELECT W.WAVE_ID FROM REPL_ORD_HDR H , REPL_ORD_DET D ,WAVE_TASK W,WAVE_TASK_DET T "
+" WHERE H.REPL_ORDER = D.REPL_ORDER AND D.PICK_ORDER = ? AND LINE_NO__PICK = ? "
+" AND W.CANCEL <> 'Y'AND T.WAVE_ID = W.WAVE_ID AND H.WAVE_ID = W.WAVE_ID "
+" AND T.REF_ID = H.REPL_ORDER AND W.WAVE_ID <> ? ";
sqlDep = "SELECT REPL_ORDER,LINE_NO FROM REPL_ORD_DET WHERE PICK_ORDER = ? AND LINE_NO__PICK = ? "
+" AND CASE WHEN CANCEL_MODE IS NULL THEN 'N' ELSE CANCEL_MODE END <> 'Y' ";
//Changed by Rohan on 26-02-13 for pick reference in all cases.start
/*
if(!"Q".equalsIgnoreCase(replType))
{
//if dso-pnd,pnd-caspk repl dependent two pick in two wave IDS
//Changed by Rohan on 21-02-13 for to check repanishment wave cancel or not
//sqlDep1 = "SELECT PICK_ORDER,LINE_NO FROM PICK_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO__REPL = ? AND PICK_ORDER <> ? ";
sqlDep1 = "SELECT P.PICK_ORDER,P.LINE_NO FROM PICK_ORD_DET P ,WAVE_TASK W,WAVE_TASK_DET D WHERE REPL_ORDER = ? AND LINE_NO__REPL = ? "
+" AND PICK_ORDER <> ? AND D.REF_ID = P.PICK_ORDER AND D.WAVE_ID = W.WAVE_ID AND CASE WHEN W.CANCEL IS NULL THEN 'N' "
+" ELSE CANCEL END <> 'Y' ";
}
*/
sqlDep1 = "SELECT P.PICK_ORDER,P.LINE_NO FROM PICK_ORD_DET P ,WAVE_TASK W,WAVE_TASK_DET D WHERE REPL_ORDER = ? AND LINE_NO__REPL = ? "
+" AND PICK_ORDER <> ? AND D.REF_ID = P.PICK_ORDER AND D.WAVE_ID = W.WAVE_ID AND CASE WHEN W.CANCEL IS NULL THEN 'N' "
+" ELSE CANCEL END <> 'Y' ";
//Changed by Rohan on 26-02-13 for pick reference in all cases.end
pstmt2 = conn.prepareStatement(sqlDep);
pstmt2.setString(1, replOrdOrg);
pstmt2.setString(2, replLineOrg);
/*if(!"Q".equalsIgnoreCase(replType) && !"J".equalsIgnoreCase(replType) && !"K".equalsIgnoreCase(replType) && !"I".equalsIgnoreCase(replType) )
{
pstmt2.setString(3, pickOrder);
}*/
pstmt2 = conn.prepareStatement(sqlPickWave);
pstmt2.setString(1,replOrdOrg);
pstmt2.setString(2,replLineOrg);
pstmt2.setString(3,waveID);
rs2 = pstmt2.executeQuery();
if(rs2.next())
{
//ordRepl = rs2.getString(1);
replOrdDep = checkNull(rs2.getString("REPL_ORDER"));
replOrdDepLine = checkNull(rs2.getString("LINE_NO"));
}
if(pstmt2 != null)
{
pstmt2.close();
pstmt2 = null;
}
if(rs2 != null)
{
rs2.close();
rs2 = null;
}
//Changed by Rohan on 26-02-13 for pick reference in all cases.start
//if("".equalsIgnoreCase(replOrdDep) && !"Q".equalsIgnoreCase(replType))
if("".equalsIgnoreCase(replOrdDep))
{
pstmt2 = conn.prepareStatement(sqlDep1);
pstmt2.setString(1, replOrdOrg);
pstmt2.setString(2, replLineOrg);
pstmt2.setString(3, pickOrder);
rs2 = pstmt2.executeQuery();
if(rs2.next())
{
//ordRepl = rs2.getString(1);
replOrdDep = checkNull(rs2.getString("PICK_ORDER"));
replOrdDepLine = checkNull(rs2.getString("LINE_NO"));
}
}
pstmt1.clearParameters();
waveIDCmp = "";
System.out.println(":::::::::Repanishment Depended ::::");
isDepRepl = true;
if(!"".equalsIgnoreCase(replOrdDep) && replOrdDep.trim().length() > 0)
{
pstmt1.setString(1, replOrdDep);
rs1 = pstmt1.executeQuery();
while(rs1.next())
{
waveIDCmp = rs1.getString("WAVE_ID");
if(!waveIDCmp.trim().equalsIgnoreCase(waveID.trim()) && !"".equalsIgnoreCase(waveIDCmp))
{
isDepRepl = true;
break;
}
}
}
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
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 04-03-13 for check Depended repanishment.start
if(isDepRepl)
{
//Changed by Rohan on 22-01-13 to cancle independent Repanishment.end
......
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