Commit 4eb7340f authored by steurwadkar's avatar steurwadkar

Changes made to generate wave task from distribution order

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@182894 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c51e99e2
......@@ -288,7 +288,16 @@ public class CheckSheetIC extends ValidatorEJB implements CheckSheetICLocal,Chec
" AND SD.REF_SER = ?";
pstmt = conn.prepareStatement( sql );
pstmt.setString( 1, shipmentId );
pstmt.setString( 2, "S-DSP" );
//Changed by Santosh on 02/04/2018 to generate wave task from dist order [Start]
if("S-ORD".equalsIgnoreCase(tranRefSer))
{
pstmt.setString( 2, "S-DSP" );
}
else if("D-ORD".equalsIgnoreCase(tranRefSer))
{
pstmt.setString( 2, "D-ISS" );
}
//Changed by Santosh on 02/04/2018 to generate wave task from dist order [End]
rs = pstmt.executeQuery();
if( rs.next() )
{
......
......@@ -190,6 +190,7 @@ public class ShipmentConf extends ActionHandlerEJB implements ShipmentConfLocal,
int remainProNo = 0,siteTranCnt = 0;
DistCommon distCommon = new DistCommon();
//Changes by Dadaso pawar on 01/03/15 [END]
int pendLineCnt = 0;
try
{
//Changed and Commented By Santosh on 14-06-2016 :[START]
......@@ -1309,22 +1310,53 @@ public class ShipmentConf extends ActionHandlerEJB implements ShipmentConfLocal,
if("D-ORD".equalsIgnoreCase(tranRefSer))
{
sSQLUpdatSord = " UPDATE DISTORDER SET STATUS = ? WHERE "
+ " DIST_ORDER IN (SELECT DIST_ORDER FROM DISTORD_ISS D,SHIP_DOCS S "
+ " WHERE D.TRAN_ID = S.REF_ID AND S.SHIPMENT_ID = ?) ";
sql = " SELECT COUNT(1) AS PEND_LINE_CNT FROM DISTORDER_DET "
+ " WHERE (CASE WHEN QTY_ORDER IS NULL THEN 0 ELSE QTY_ORDER END) - (CASE WHEN QTY_SHIPPED IS NULL THEN 0 ELSE QTY_SHIPPED END) > 0 "
+ " AND DIST_ORDER = (SELECT DIST_ORDER FROM DISTORD_ISS D,SHIP_DOCS S WHERE D.TRAN_ID = S.REF_ID AND S.SHIPMENT_ID = ?)";
pstmtSord = conn.prepareStatement(sSQLUpdatSord);
pstmtSord.setString(1, "C");
pstmtSord.setString(2, tranId);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
int distOrdCnt = pstmtSord.executeUpdate();
System.out.println("Distorder update cnt ["+distOrdCnt+"]");
if(rs.next())
{
pendLineCnt = rs.getInt("PEND_LINE_CNT");
}
if(pstmtSord != null)
if(pstmt != null)
{
pstmtSord.close();
pstmtSord = null;
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
System.out.println("pending lines cnt in distribution order["+pendLineCnt+"]");
if(pendLineCnt == 0)
{
sSQLUpdatSord = " UPDATE DISTORDER SET STATUS = ? WHERE "
+ " DIST_ORDER IN (SELECT DIST_ORDER FROM DISTORD_ISS D,SHIP_DOCS S "
+ " WHERE D.TRAN_ID = S.REF_ID AND S.SHIPMENT_ID = ?) ";
pstmtSord = conn.prepareStatement(sSQLUpdatSord);
pstmtSord.setString(1, "C");
pstmtSord.setString(2, tranId);
int distOrdCnt = pstmtSord.executeUpdate();
System.out.println("Distorder update cnt ["+distOrdCnt+"]");
if(pstmtSord != null)
{
pstmtSord.close();
pstmtSord = null;
}
}
}
}
......
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