Commit adade008 authored by ppatro's avatar ppatro

Issuetracker point 10 239,240,242....


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93420 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d818b4e5
......@@ -21,9 +21,11 @@ import ibase.webitm.ejb.*;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.dis.*;
import ibase.webitm.utility.TransIDGenerator;
import ibase.utility.CommonConstants;
//Changed by Rohan on 24-07-13 for importing adv packages
import ibase.webitm.ejb.dis.adv.*;
@javax.ejb.Stateless
public class AsnLotStatConf extends ValidatorEJB implements AsnLotStatConfLocal, AsnLotStatConfRemote
{
......@@ -52,7 +54,24 @@ public class AsnLotStatConf extends ValidatorEJB implements AsnLotStatConfLocal,
String tranIdGenerate = "";
boolean flag = false;
//Change by Rohan on 25-07-13 for define variable.start
boolean isHoldHdr = false;
String invholdSql = "";
String invholddetSql = "";
String tranIdHold = "";
String lockCodeRej = "";
String locCode = "";
String lotSl = "";
int lineNoHoldCtr = 0;
PreparedStatement pstmtHdr = null;
PreparedStatement pstmtDet = null;
ResultSet rsHdr = null;
ResultSet rsDet = null;
DistCommon discommon = new DistCommon();
//Change by Rohan on 25-07-13 for define variable.end
int count = 0;
int updCnt = 0;
int ctr = 0;
......@@ -112,12 +131,23 @@ public class AsnLotStatConf extends ValidatorEJB implements AsnLotStatConfLocal,
{
System.out.println( updCnt + " rows updated successfully" );
}
//Chnaged by Rohan on 25-07-13 for if lot staus 'R' then aquried new lock configured in disparam.start
invholdSql = "INSERT INTO INV_HOLD(TRAN_ID,TRAN_DATE,SITE_CODE,CONFIRMED,REF_ID,REF_SER,CHG_USER,CHG_DATE,CHG_TERM, LOCK_CODE,REF_NO) VALUES(?,?,?,?,?,?,?,?,?,?,?)";
pstmtHdr = conn.prepareStatement(invholdSql);
invholddetSql = "INSERT INTO INV_HOLD_DET(TRAN_ID,LINE_NO,ITEM_CODE,SITE_CODE,LOC_CODE,LOT_NO,LOT_SL,HOLD_STATUS,SCH_REL_DATE) VALUES(?,?,?,?,?,?,?,?,?)";
pstmtDet = conn.prepareStatement(invholddetSql);
lockCodeRej = discommon.getDisparams("999999","REJECTION_LOCKCODE",conn);
//Chnaged by Rohan on 25-07-13 for if lot staus 'R' then aquried new lock configured in disparam.end
int length = dom.getElementsByTagName( "Detail2").getLength();
for ( int pctr = 0; pctr < length; pctr++ )
{
lotStatus = GenericUtility.getInstance().getColumnValueFromNode("lot_status", dom.getElementsByTagName("Detail2").item(pctr));
if(lotStatus.equalsIgnoreCase("A"))
//Changed by Rohan on 24-07-13 for release lot staus 'R'
//if(lotStatus.equalsIgnoreCase("A"))
if((!"".equalsIgnoreCase(lotStatus) && lotStatus != null))
{
lineNo = GenericUtility.getInstance().getColumnValueFromNode("line_no", dom.getElementsByTagName("Detail2").item(pctr));
itemCodeDet = GenericUtility.getInstance().getColumnValueFromNode("item_code", dom.getElementsByTagName("Detail2").item(pctr));
......@@ -139,9 +169,40 @@ public class AsnLotStatConf extends ValidatorEJB implements AsnLotStatConfLocal,
if(count != 0)
{
ctr++;
//flag = true;
sql = "select ih.tran_id, ih.line_no from inv_hold h, inv_hold_det ih"
//Chnaged by Rohan on 25-07-13 for if lot staus 'R' then aquried new lock configured in disparam.start
if((!"".equalsIgnoreCase(lotStatus) && lotStatus != null) && !lotStatus.equalsIgnoreCase("A") && !isHoldHdr)
{
tranIdHold = generateTranId( "w_inv_hold", siteCode, currDateStr, conn );
System.out.println("tranIdHold"+tranIdHold);
pstmtHdr.setString( 1, tranIdHold );
pstmtHdr.setTimestamp( 2, currDate);
pstmtHdr.setString( 3, siteCode );
pstmtHdr.setString( 4, "N" );
pstmtHdr.setString( 5, tranIdGenerate );
pstmtHdr.setString( 6, "P-RCP");
pstmtHdr.setString( 7, userId );
pstmtHdr.setTimestamp( 8, currDate );
pstmtHdr.setString( 9, chgTerm );
pstmtHdr.setString( 10, lockCodeRej );
pstmtHdr.setString( 11, tranId );
updCnt = pstmtHdr.executeUpdate();
pstmtHdr.clearParameters();
if( updCnt > 0 )
{
isHoldHdr = true;
System.out.println( updCnt + " rows updated successfully" );
}
}
//Chnaged by Rohan on 25-07-13 for if lot staus 'R' then aquried new lock configured in disparam.end
//CHanged by Rohan on 26-07-13 for getting loc code and lot sl.
//sql = "select ih.tran_id, ih.line_no from inv_hold h, inv_hold_det ih"
sql = "select ih.tran_id, ih.line_no,ih.loc_code,ih.lot_sl from inv_hold h, inv_hold_det ih"
+" where h.tran_id = ih.tran_id"
+" and h.ref_id in ("
+" select p.tran_id from porcp p where p.asn_no in ("
......@@ -171,6 +232,25 @@ public class AsnLotStatConf extends ValidatorEJB implements AsnLotStatConfLocal,
pRelDet.setString( 5, remark );
pRelDet.addBatch();
pRelDet.clearParameters();
//Chnaged by Rohan on 25-07-13 for if lot staus 'R' then aquried new lock configured in disparam.start
if((!"".equalsIgnoreCase(lotStatus) && lotStatus != null) && !lotStatus.equalsIgnoreCase("A"))
{
lineNoHoldCtr++;
locCode = checkNull(rs.getString("loc_code"));
lotSl = checkNull(rs.getString("lot_sl"));
pstmtDet.setString( 1, tranIdHold );
pstmtDet.setInt( 2, lineNoHoldCtr );
pstmtDet.setString( 3, itemCodeDet );
pstmtDet.setString( 4, siteCode );
pstmtDet.setString( 5, locCode );
pstmtDet.setString( 6, lotNoDet );
pstmtDet.setString( 7, lotSl );
pstmtDet.setString( 8, "H" );
pstmtDet.setTimestamp( 9, currDate );
pstmtDet.addBatch();
pstmtDet.clearParameters();
}
//Chnaged by Rohan on 25-07-13 for if lot staus 'R' then aquried new lock configured in disparam.end
}
rs.close();
......@@ -187,13 +267,81 @@ public class AsnLotStatConf extends ValidatorEJB implements AsnLotStatConfLocal,
}
}
}//lotStatus = 'A'
}//for pctr
pRelDet.executeBatch();
pRelDet.clearBatch();
//Changed by Rohan on 26-07-13 for execute batch .strat
pstmtDet.executeBatch();
pstmtDet.clearBatch();
if(pstmtDet != null)
{
pstmtDet.close();
pstmtDet = null;
}
if(pstmtHdr != null)
{
pstmtHdr.close();
pstmtHdr = null;
}
//Changed by Rohan on 26-07-13 for execute batch .end
//if(flag == true)
if(length == ctr)
{
//Chaged by Rohan on 24-07-13 for releasing stock.start
System.out.println("888888888888 GOing for release old lock 888888888888888888888888");
InvHoldRelConf InvHoldRelConf = new InvHoldRelConf();
//confirm(tranIdRel,xtraParams,"F", conn, false);
errMsg = InvHoldRelConf.confirm( tranIdGenerate,xtraParams,"F",conn,false);
if ( errMsg == null && errMsg.trim().length() <= 0 )
{
errMsg = itmDBAccessLocal.getErrorString("","VTPRCERR","");
return errMsg;
}
//Changed by Rohan on 24-07-13 for release lot staus 'R' and then put REJECTION_LOCKCODE.start
if((!"".equalsIgnoreCase(lotStatus) && lotStatus != null) && !lotStatus.equalsIgnoreCase("A"))
{
System.out.println("888888888888 GOing for aqurie new lock 888888888888888888888888");
//update stock hold qty.start
sql = "UPDATE STOCK SET HOLD_QTY = QUANTITY WHERE ITEM_CODE = ? AND SITE_CODE = ? "
+" AND LOC_CODE = ? AND LOT_NO = ? AND LOT_SL = ? ";
pStmt = conn.prepareStatement(sql);
pStmt.setString( 1, itemCodeDet );
pStmt.setString( 2, siteCode );
pStmt.setString( 3, locCode );
pStmt.setString( 4, lotNoDet );
pStmt.setString( 5, lotSl );
int rowcnt = pStmt.executeUpdate();
if(rowcnt == 0)
{
errMsg = itmDBAccessLocal.getErrorString("","VTPRCERR","");
return errMsg;
}
else
{
System.out.println("**************stk hold succefuly ****************");
}
if(pStmt != null)
{
pStmt.close();
pStmt = null;
}
//update stock hold qty.end
InvHoldConf invHoldConf = new InvHoldConf();
errMsg = invHoldConf.confirm(tranIdHold,xtraParams, "F" ,conn,false);
if ( errMsg == null && errMsg.trim().length() <= 0 )
{
errMsg = itmDBAccessLocal.getErrorString("","VTPRCERR","");
return errMsg;
}
}
//Changed by Rohan on 24-07-13 for release lot staus not 'R' and then put REJECTION_LOCKCODE.end
//Chaged by Rohan on 24-07-13 for releasing stock.end
sql = "update asn_lot_stat set confirmed = 'Y', conf_date = ? where tran_id = ?";
pStmt = conn.prepareStatement(sql);
pStmt.setTimestamp(1,currDate);
......@@ -201,14 +349,10 @@ public class AsnLotStatConf extends ValidatorEJB implements AsnLotStatConfLocal,
int rowcnt = pStmt.executeUpdate();
if(rowcnt == 0)
{
errMsg = itmDBAccessLocal.getErrorString("","VTMCONF9","");
errMsg = itmDBAccessLocal.getErrorString("","VTPRCERR","");
return errMsg;
}
else
{
//errMsg = itmDBAccessLocal.getErrorString("","VTMCONF2","");
//return errMsg;
}
}
}
......@@ -250,6 +394,7 @@ public class AsnLotStatConf extends ValidatorEJB implements AsnLotStatConfLocal,
{
try
{
if(pRelDet != null)
{
pRelDet.close();
......@@ -265,6 +410,28 @@ public class AsnLotStatConf extends ValidatorEJB implements AsnLotStatConfLocal,
pStmt.close();
pStmt = null;
}
//Chnaged by Rohan on 24-07-13 for commiting connection.start
if(pstmtDet != null)
{
pstmtDet.close();
pstmtDet = null;
}
if(pstmtHdr != null)
{
pstmtHdr.close();
pstmtHdr = null;
}
if ( errMsg != null && errMsg.trim().length() > 0 && errMsg.indexOf("success") != -1 )
{
conn.commit();
errMsg = "";
}
else
{
conn.rollback();
}
//Chnaged by Rohan on 24-07-13 for commiting connection.start
}
catch(Exception ex)
{
......
......@@ -521,18 +521,39 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
}
//
update = 0;
sql = " UPDATE CARTON_MASTER SET CHANGE_STATUS = ? WHERE MASTER_CARTON = " +
" (SELECT MASTER_CARTON FROM CARTON_MASTER WHERE CARTON_NO = ? AND MASTER_CARTON IS NOT NULL)";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, "Y");
pstmt2.setString(2, cartonNo);
update = pstmt2.executeUpdate();
if( update > 0 )
if(!"A".equalsIgnoreCase(pPickType))
{
System.out.println(" WAVE_STATUS_ORG_DET updated succefully ");
update = 0;
sql = " UPDATE CARTON_MASTER SET CHANGE_STATUS = ? WHERE MASTER_CARTON = " +
" (SELECT MASTER_CARTON FROM CARTON_MASTER WHERE CARTON_NO = ? AND MASTER_CARTON IS NOT NULL)";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, "Y");
pstmt2.setString(2, cartonNo);
update = pstmt2.executeUpdate();
if( update > 0 )
{
System.out.println(" WAVE_STATUS_ORG_DET updated succefully for Masters----");
}
pstmt2.close(); pstmt2 = null;
}
else
{
update = 0;
sql = " UPDATE CARTON_MASTER SET CHANGE_STATUS = ? WHERE CARTON_NO = ? AND STATUS <> ? " ;
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, "Y");
pstmt2.setString(2, cartonNo);
pstmt2.setString(3, "R");
update = pstmt2.executeUpdate();
if( update > 0 )
{
System.out.println(" WAVE_STATUS_ORG_DET updated succefully for Actives ------ ");
}
pstmt2.close(); pstmt2 = null;
}
pstmt2.close(); pstmt2 = null;
}
rs.close(); rs = null;
......
......@@ -431,11 +431,12 @@ etc
if( "N".equalsIgnoreCase(rs.getString("HOLD_STATUS")) && "N".equalsIgnoreCase(rs.getString("CANCEL")))
{
sql = "SELECT REF_TYPE FROM WAVE_TASK_DET WHERE WAVE_ID = ? AND REF_TYPE IN (?,?)";
sql = "SELECT REF_TYPE FROM WAVE_TASK_DET WHERE WAVE_ID = ? AND REF_TYPE IN (?,?,?)";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, waveId);
pstmt1.setString(2, "M");
pstmt1.setString(3, "P");
pstmt1.setString(4, "A");
rs1 = pstmt1.executeQuery();
if( !rs1.next())
{
......@@ -477,7 +478,7 @@ etc
{
ptcn = checkNull(genericUtility.getColumnValue( "ptcn", currFormDataDom ));
waveId = checkNull(genericUtility.getColumnValue( "wave_id", currFormDataDom ));
String cartonType = "";
System.out.println(" ptcn ["+ptcn+"] waveId ["+waveId+"]");
if(ptcn.trim().length() > 0 )
{
......@@ -490,7 +491,9 @@ etc
while( rs.next())
{
isRecordExist = true;
if( "P".equalsIgnoreCase(rs.getString("CARTON_TYPE")) || "M".equalsIgnoreCase(rs.getString("CARTON_TYPE")))
cartonType = rs.getString("CARTON_TYPE");
//if( "P".equalsIgnoreCase(rs.getString("CARTON_TYPE")) || "M".equalsIgnoreCase(rs.getString("CARTON_TYPE")))
if( "P".equalsIgnoreCase(cartonType) || "M".equalsIgnoreCase(cartonType) || "A".equalsIgnoreCase(cartonType))
{
isMasterOrParcelPresent = true;
continue;
......
......@@ -1013,6 +1013,22 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
System.out.println( updCnt + " row of wave_status updated successfully" );
}
//Changed By Pragyan WM3DSUN015 To update status in Sorder as InProcess after start scaning .start
sql = "UPDATE SORDER SET SHIP_STATUS = ? WHERE SALE_ORDER = ?";
pstmtSord = conn.prepareStatement(sql);
int updateSorder = 0;
pstmtSord.setString(1, "P");
pstmtSord.setString(2, saleOrder);
updateSorder = pstmtSord.executeUpdate();
if(updateSorder > 0)
{
System.out.println(" SORDER UPDATE COUNT ["+updateSorder+"]");
}
pstmtSord.clearParameters();
//Changed By Pragyan WM3DSUN015 To update status in Sorder as InProcess after after start scaning .end
//Changed by sumit on 07/08/12 for checking whether pick iss is inserted or not if yes then remaining, wave_task of M-Pack ref_ser will updated 'c' end.
/*Added by Ashish Sonawane on 11-SEP-12 for calling consolidate to doc after status of PICK_ORD_HDR gets close [START]*/
......
......@@ -1348,6 +1348,29 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
pstmtUpd.close();
pstmtUpd = null;
}
//Changed By Pragyan WM3DSUN015 To update status in Sorder as InProcess after start scaning .start
sql = "UPDATE SORDER SET SHIP_STATUS = ? WHERE SALE_ORDER = ?";
pstmtUpd = conn.prepareStatement(sql);
int updateSorder = 0;
pstmtUpd.setString(1, "P");
pstmtUpd.setString(2, saleOrder);
updateSorder = pstmtUpd.executeUpdate();
if(updateSorder > 0)
{
System.out.println(" SORDER UPDATE COUNT ["+updateSorder+"]");
}
pstmtUpd.clearParameters();
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed By Pragyan WM3DSUN015 To update status in Sorder as InProcess after after start scaning .end
ConsolidatToDoc conToDoc = new ConsolidatToDoc();
//Changed by Rohan on 10-06-12 to add xtraParams in process as argument for hazmap report to get chg user
//retString = conToDoc.process(ptcn, conn);
......
......@@ -218,8 +218,9 @@ etc
" FROM SORDER S, CUSTOMER C, WAVE_TYPE W WHERE SALE_ORDER = ? " +
" AND C.CUST_CODE = S.CUST_CODE " +
" AND C.WAVE_TYPE = W.WAVE_TYPE ";*/
sSQL = " SELECT S.DUE_DATE,S.CUST_CODE,S.CUST_CODE__DLV, C.SINGLE_LOT, W.MASTER_PACK_ALLOW, W.ACTIVE_PICK_ALLOW," +
//Changed By Sankara 02/aug/13 to take single lot from saleorder[WM3DESUN002]
//sSQL = " SELECT S.DUE_DATE,S.CUST_CODE,S.CUST_CODE__DLV, C.SINGLE_LOT, W.MASTER_PACK_ALLOW, W.ACTIVE_PICK_ALLOW," +
sSQL = " SELECT S.DUE_DATE,S.CUST_CODE,S.CUST_CODE__DLV, S.SINGLE_LOT, W.MASTER_PACK_ALLOW, W.ACTIVE_PICK_ALLOW," +
" W.STOCK_TO_DOCK_ALLOW, W.PARCELPACK_ALLOW "+
" FROM SORDER S, CUSTOMER C, WAVE_TYPE W WHERE SALE_ORDER = ? " +
" AND C.CUST_CODE = S.CUST_CODE__DLV " +
......@@ -378,8 +379,9 @@ etc
" FROM SORDER S, CUSTOMER C, WAVE_TYPE W WHERE SALE_ORDER = ? " +
" AND C.CUST_CODE = S.CUST_CODE " +
" AND C.WAVE_TYPE = W.WAVE_TYPE ";*/
sSQL = " SELECT S.DUE_DATE,S.CUST_CODE,S.CUST_CODE__DLV, C.SINGLE_LOT, W.MASTER_PACK_ALLOW, W.ACTIVE_PICK_ALLOW," +
//Changed By Sankara 02/aug/13 to take single lot from saleorder[WM3DESUN002]
//sSQL = " SELECT S.DUE_DATE,S.CUST_CODE,S.CUST_CODE__DLV, C.SINGLE_LOT, W.MASTER_PACK_ALLOW, W.ACTIVE_PICK_ALLOW," +
sSQL = " SELECT S.DUE_DATE,S.CUST_CODE,S.CUST_CODE__DLV, S.SINGLE_LOT, W.MASTER_PACK_ALLOW, W.ACTIVE_PICK_ALLOW," +
" W.STOCK_TO_DOCK_ALLOW, W.PARCELPACK_ALLOW "+
" FROM SORDER S, CUSTOMER C, WAVE_TYPE W WHERE SALE_ORDER = ? " +
" AND C.CUST_CODE = S.CUST_CODE__DLV " +
......@@ -922,8 +924,9 @@ etc
{
columnValue = childNode.getFirstChild().getNodeValue();
}
//Changed By Sankara as this warning is not required as single lot value has been changed in sales order.start
System.out.println(" columnName [" + childNodeName + "] columnValue [" + columnValue + "]");
if ( "single_lot".equalsIgnoreCase( childNodeName ) )
/*if ( "single_lot".equalsIgnoreCase( childNodeName ) )
{
singleLot = checkNull(genericUtility.getColumnValue( "single_lot", currFormDataDom ));
//Changed by sankara on 26-06-13 for customer code as customer code delivery
......@@ -957,8 +960,9 @@ etc
pstmt = null;
}
}
}
else if ( "master_pack_allow".equalsIgnoreCase( childNodeName ) )
}*/
//Changed By Sankara as this warning is not required as single lot value has been changed in sales order.end
if ( "master_pack_allow".equalsIgnoreCase( childNodeName ) )
{
masterPackAllow = checkNull(genericUtility.getColumnValue( "master_pack_allow", currFormDataDom ));
parcelPackAllow = checkNull(genericUtility.getColumnValue( "parcelpack_allow", currFormDataDom ));
......@@ -982,12 +986,13 @@ etc
//errFields.add( "" );
}
}
if("Y".equalsIgnoreCase(parcelPackAllow) && "Y".equalsIgnoreCase(masterPackAllow))
//Changed by sankara on 01/08/13 for both parcel and master allowed for wave start.
/*if("Y".equalsIgnoreCase(parcelPackAllow) && "Y".equalsIgnoreCase(masterPackAllow))
{
errFields.add( childNodeName.toLowerCase() );
errList.add( "ONSELCMP" );
}
}*/
//Changed by sankara on 01/08/13 for both parcel and master allowed for wave end.
if( rs != null )
{
......@@ -1025,11 +1030,13 @@ etc
//errFields.add( "" );
}
}
if("Y".equalsIgnoreCase(parcelPackAllow) && "Y".equalsIgnoreCase(masterPackAllow))
//Changed by sankara on 01/08/13 for both parcel and master allowed for wave start.
/*if("Y".equalsIgnoreCase(parcelPackAllow) && "Y".equalsIgnoreCase(masterPackAllow))
{
errFields.add( childNodeName.toLowerCase() );
errList.add( "ONSELCMP" );
}
}*/
//Changed by sankara on 01/08/13 for both parcel and master allowed for wave end
if( rs != null )
{
rs.close();
......
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