Commit ed662660 authored by pjain's avatar pjain

changed by sankara on 10/09/14 update dealolocaartconf


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96222 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4108714a
...@@ -640,7 +640,10 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -640,7 +640,10 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
//Changed By Pragyan 02-JUL-14 (Issue tracker No 396)To update status as C if consolidated to doc called.start //Changed By Pragyan 02-JUL-14 (Issue tracker No 396)To update status as C if consolidated to doc called.start
else else
{ {
updateWaveStatusDespatch(tempPTCN,conn); //changed by sankara on 10/09/14 update despatch status
//updateWaveStatusDespatch(tempPTCN,conn);
updateWaveStatusDespatch(waveId,conn);
System.out.println("tempPTCN::::::::"+tempPTCN);
updateCartonMasterstatus(tempPTCN, conn); updateCartonMasterstatus(tempPTCN, conn);
//changed by sankara on 29/07/14 update despatch deallocate status in wave_task_det. //changed by sankara on 29/07/14 update despatch deallocate status in wave_task_det.
updateDespatchDeallocateStatus(tempPTCN, conn); updateDespatchDeallocateStatus(tempPTCN, conn);
...@@ -4152,12 +4155,14 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -4152,12 +4155,14 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
//changed by sankara on 21/06/14 update sorder ship_status from pick deallocation end. //changed by sankara on 21/06/14 update sorder ship_status from pick deallocation end.
//Changed By Pragyan 02-JUL-14 (Issue tracker No 396)To update status as C if consolidated to doc called.start //Changed By Pragyan 02-JUL-14 (Issue tracker No 396)To update status as C if consolidated to doc called.start
private int updateWaveStatusDespatch(String PTCN, Connection conn) throws ITMException //changed by sankara on 10/09/14 update despatch status
//private int updateWaveStatusDespatch(String PTCN, Connection conn) throws ITMException
private int updateWaveStatusDespatch(String waveId, Connection conn) throws ITMException
{ {
String sql = "", sql1 = ""; String sql = "", sql1 = "";
String waveId = "";
String saleOrder = ""; String saleOrder = "";
PreparedStatement pstmt = null; String ptcn = "";
PreparedStatement pstmt = null,pstmt1 = null;
ResultSet rs = null, rs1 = null; ResultSet rs = null, rs1 = null;
int updateCount = 0; int updateCount = 0;
int count = 0; int count = 0;
...@@ -4165,52 +4170,69 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -4165,52 +4170,69 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
try try
{ {
sql = "SELECT COUNT(*) FROM WAVE_TASK_DET WHERE PTCN = ? AND REF_SER <> 'S-DSP' AND STATUS = 'N'"; System.out.println("waveId:::::::::"+waveId);
sql = " SELECT PTCN FROM WAVE_TASK_DET WHERE WAVE_ID = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, PTCN); pstmt.setString(1, waveId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while(rs.next())
if(rs.next())
{ {
count = rs.getInt(1); ptcn = checkNull(rs.getString(1));
System.out.println("ptcn:::::"+ptcn);
sql = " SELECT COUNT(*) FROM WAVE_TASK_DET WHERE PTCN = ? AND REF_SER <> 'S-DSP' AND STATUS = 'N' ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, ptcn);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
count = rs1.getInt(1);
System.out.println("count:::::"+count);
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if( count == 0)
{
sql = "UPDATE WAVE_TASK_DET SET WAVE_STATUS = 'C' WHERE PTCN = ? AND REF_SER = 'S-DSP' ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, ptcn);
updateCount = pstmt1.executeUpdate();
if(updateCount > 0)
{
System.out.println("Despatch Has been updated as created["+updateCount+"]");
}
else
{
System.out.println("Despatch Has Not been updated as created["+updateCount+"]");
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
}
} }
if(rs != null) if(rs != null)
{ {
rs.close(); rs.close();
rs = null; rs = null;
} }
if(pstmt != null) if(pstmt != null)
{ {
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if( count == 0)
{
sql = "UPDATE WAVE_TASK_DET SET WAVE_STATUS = 'C' WHERE PTCN = ? AND REF_SER = 'S-DSP' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, PTCN);
updateCount = pstmt.executeUpdate();
if(updateCount > 0)
{
System.out.println("Despatch Has been updated as created["+updateCount+"]");
}
else
{
System.out.println("Despatch Has Not been updated as created["+updateCount+"]");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
} }
catch(Exception e) catch(Exception e)
{ {
......
...@@ -2010,7 +2010,7 @@ public class StockTransferGrlIC extends ValidatorEJB implements StockTransferGrl ...@@ -2010,7 +2010,7 @@ public class StockTransferGrlIC extends ValidatorEJB implements StockTransferGrl
+ " GROUP BY LOC_CODE " + " GROUP BY LOC_CODE "
+ " HAVING SUM (CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END) > 0) " + " HAVING SUM (CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END) > 0) "
+ " ORDER BY ABS(A.LOC_ZONE - ?),A.LOC_CODE ) WHERE ROWNUM < 5" ;*/ + " ORDER BY ABS(A.LOC_ZONE - ?),A.LOC_CODE ) WHERE ROWNUM < 5" ;*/
sql = " SELECT LOC_CODE,LOC_ZONE,LOC_TYPE FROM (SELECT A.LOC_CODE, A.LOC_ZONE, A.LOC_TYPE,FN_CHECK_VALID_LOC(?,LOC_CODE) AS LOC_CHECK_COUNT " sql = " SELECT LOC_CODE,LOC_ZONE,LOC_TYPE FROM (SELECT A.LOC_CODE, A.LOC_ZONE, A.LOC_TYPE,FN_CHECK_VALID_LOC(?,A.LOC_CODE) AS LOC_CHECK_COUNT "
+" FROM LOCATION A ,INVSTAT B " +" FROM LOCATION A ,INVSTAT B "
+ " WHERE A.INV_STAT =B.INV_STAT AND B.AVAILABLE = 'Y' AND A.LOC_TYPE = ? " + " WHERE A.INV_STAT =B.INV_STAT AND B.AVAILABLE = 'Y' AND A.LOC_TYPE = ? "
+ " AND A.INV_STAT IN ("+invStstPars+") " + " AND A.INV_STAT IN ("+invStstPars+") "
...@@ -2019,7 +2019,7 @@ public class StockTransferGrlIC extends ValidatorEJB implements StockTransferGrl ...@@ -2019,7 +2019,7 @@ public class StockTransferGrlIC extends ValidatorEJB implements StockTransferGrl
+ " SITE_CODE= ? AND INV_STAT IN ("+invStstPars+") " + " SITE_CODE= ? AND INV_STAT IN ("+invStstPars+") "
+ " GROUP BY LOC_CODE " + " GROUP BY LOC_CODE "
+ " HAVING SUM (CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END) > 0) " + " 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 " ; + " ORDER BY ABS(A.LOC_ZONE - ?),A.LOC_CODE ) WHERE LOC_CHECK_COUNT > 0 AND ROW_NUM < 5" ;
// Changed by sankara on 27/08/13 for optimized the sql end. // Changed by sankara on 27/08/13 for optimized the sql 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