Commit 2cda7a46 authored by ppatro's avatar ppatro

bug found in release


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93365 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 89739781
...@@ -70,7 +70,7 @@ public class PalletMergePos extends ValidatorEJB implements PalletMergePosLocal, ...@@ -70,7 +70,7 @@ public class PalletMergePos extends ValidatorEJB implements PalletMergePosLocal,
pstmt = null; pstmt = null;
//Changed by Pragyan on 19/07/13 update new pallet no in master pack hdr start. //Changed by Pragyan on 19/07/13 update new pallet no in master pack hdr start.
sSQL = "UPDATE PICK_HDR SET PALLET_NO = ? WHERE PALLET_NO = ? "; sSQL = "UPDATE PACK_HDR SET PALLET_NO = ? WHERE PALLET_NO = ? ";
pstmt = conn.prepareStatement(sSQL); pstmt = conn.prepareStatement(sSQL);
pstmt.setString(1, palletNoNew); pstmt.setString(1, palletNoNew);
pstmt.setString(2, palletNo); pstmt.setString(2, palletNo);
......
...@@ -227,8 +227,916 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -227,8 +227,916 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
} }
return rtrStr; return rtrStr;
} }
//Changed BY Pragyan 20JUL13 TO Optimize the code for Open maximum open cursors.start
public String getData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException
{
String errCode = "";
String errString = "";
String getDataSql= "" ;
String sql= "" ;
String resultString = "";
Connection conn = null;
ResultSet rs = null;
ResultSet rs1 = null;
PreparedStatement pstmt = null;
Statement st = null;
StringBuffer retTabSepStrBuff = new StringBuffer();
double pendQty = 0;
double allocQty = 0;
boolean bappend = false ;
HashMap tempMap = null;
//Changed by Rohan on 29-12-11 as said by gulzar.start
String sSQL = "";
String sSingleLotSql = "";
String resrvLoc = "";
String casePickLoc = "";
String activePickLoc = "";
String deepStoreLoc = "";
String partialResrvLoc = "";
String packInstr ="";
PreparedStatement pstmtStock = null;
double balStockQtyTemp = 0.0,sordItemQty=0.0,balStk=0.0;
String partQtyValue = "", allocFlag = "";
double holdQty = 0;
String orderByStkStr = "";
//Changed by sumit sarkar on 22/06/12 start.
//Changed by sumit on 20/08/12 to show wave allow start.
String masterPackAllow = "";
String activePickAllow = "";
String stockToDockAllow = "";
String parcelPackAllow = "";
String pickType = "";
String directPickLoc = "";
//Changed by sumit on 20/08/12 to show wave allow end.
//Change by Rohan on 19/07/12 to get transporter Info.start
HashMap getTranInfo = null;
String saleOrderTran = "";
String tranCod = "";
String docLocation = "";
String sqlTran = "";
String tranName = "";
PreparedStatement pstmtTran = null;
ResultSet rsTran = null;
//Changed By Pragyan 17/12/12 to get the standard UOM and order UOM.Start
String unit,unitStd,mbaseUnit = "";
String shipType = "";
double meffQty = 0,convQtyStduom = 0 ,convFact = 0, quantity = 0.0;
String sqlFnManual = "",sqlTotHoldQty = "",sqlManQty = "";
PreparedStatement pstmt1 = null,pstmtManul = null,pstmtHold = null,pstmtManQty = null;
ResultSet rs2 = null,rsMan = null,rsHld = null,rsM = null;
retTabSepStrBuff = new StringBuffer( "<?xml version='1.0' encoding='UTF-8'?>\r\n<DocumentRoot>\r\n<description>Datawindow Root</description>\r\n<group0>\r\n" +
"<description>Group0 description</description>\r\n<Header0>\r\n<description>Header0 members</description>\r\n");
try
{
ConnDriver connDriver = new ConnDriver();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getDBDateFormat());
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
siteCode = genericUtility.getColumnValue("site_code",headerDom);
if ( siteCode == null || siteCode.trim().length() == 0 )
{
siteCode = "";
System.out.println("Site Code From is Null...");
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString;
}
System.out.println("SITE CODE ::"+ siteCode);
postOrderFg = "N";
/*
postOrderFg = genericUtility.getColumnValue("post_order_flag",headerDom);
if(postOrderFg == null || postOrderFg.trim().length() == 0)
{
postOrderFg = "";
System.out.println("Site Code From is Null...");
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString;
}
*/
System.out.println("postOrderFg ::"+ postOrderFg);
itemSerFr = genericUtility.getColumnValue("item_ser__from",headerDom);
if ( itemSerFr == null || itemSerFr.trim().length() == 0 )
{
itemSerFr = "";
System.out.println("Item Series From is Null...");
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString;
}
System.out.println("Item Ser FR "+ itemSerFr);
itemSerTo = genericUtility.getColumnValue("item_ser__to",headerDom);
if ( itemSerTo == null || itemSerTo.trim().length() == 0 )
{
itemSerTo = "";
System.out.println("Item Series To is Null...");
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString;
}
System.out.println("Item Ser To"+itemSerTo);
custCodeFr = genericUtility.getColumnValue("cust_code__from",headerDom);
if ( custCodeFr == null || custCodeFr.trim().length() == 0 )
{
custCodeFr = "";
System.out.println("Cust Code From is Null...");
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString;
}
System.out.println("custCodeFr"+ custCodeFr);
custCodeTo = genericUtility.getColumnValue("cust_code__to",headerDom);
if ( custCodeTo == null || custCodeTo.trim().length() == 0 )
{
custCodeTo = "";
System.out.println("Cust Code To is Null...");
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString;
}
System.out.println("custCodeTo"+ custCodeTo);
custCodeDlvFr = genericUtility.getColumnValue("cust_code__dlv__from",headerDom);
if ( custCodeDlvFr == null || custCodeDlvFr.trim().length() == 0 )
{
custCodeDlvFr = "";
System.out.println("Cust Code Dlv From is Null...");
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString;
}
System.out.println("custCodeDlvFr"+ custCodeDlvFr);
custCodeDlvTo = genericUtility.getColumnValue("cust_code__dlv__to",headerDom);
if ( custCodeDlvTo == null || custCodeDlvTo.trim().length() == 0 )
{
custCodeDlvTo = "";
System.out.println("Cust Code Dlv To is Null...");
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString;
}
System.out.println("custCodeDlvTo"+ custCodeDlvTo);
saleOrderFr = genericUtility.getColumnValue("sale_order__from",headerDom);
if ( saleOrderFr == null || saleOrderFr.trim().length() == 0 )
{
saleOrderFr = "";
System.out.println("Sale Order From is Null...");
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString;
}
saleOrderTo = genericUtility.getColumnValue("sale_order__to",headerDom);
if ( saleOrderTo == null || saleOrderTo.trim().length() == 0 )
{
saleOrderTo = "";
System.out.println("Sale Order To is Null...");
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString;
}
sDateFr = genericUtility.getColumnValue("due_date__from",headerDom);
if ( sDateFr == null || sDateFr.trim().length() == 0 )
{
sDateFr = "";
System.out.println("Date From is Null...");
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString;
}
sDateFr = genericUtility.getValidDateString(sDateFr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat());
dateFr = java.sql.Timestamp.valueOf(sDateFr + " 00:00:00");
sDateTo = genericUtility.getColumnValue("due_date__to",headerDom);
if ( sDateTo == null || sDateTo.trim().length() == 0 )
{
sDateTo = "";
System.out.println("Date To is Null...");
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString;
}
sDateTo = genericUtility.getValidDateString(sDateTo, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat());
dateTo = java.sql.Timestamp.valueOf(sDateTo + " 00:00:00");
DefaultQtyFlag = genericUtility.getColumnValue("default_qty_flag",headerDom);
if(DefaultQtyFlag == null || DefaultQtyFlag.trim().length() == 0)
{
DefaultQtyFlag = "";
System.out.println("Default Qty flag is Null...");
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString;
}
//Change by sumit sarkar on 09/03/12 getting the value of itemCodeFr and itemCodeTo Start.
itemCodeFr = genericUtility.getColumnValue("item_code__from",headerDom);
if ( itemCodeFr == null || itemCodeFr.trim().length() == 0 )
{
itemCodeFr = "";
System.out.println("Item Code from is Null...");
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString;
}
itemCodeTo = genericUtility.getColumnValue("item_code__to",headerDom);
if ( itemCodeTo == null || itemCodeTo.trim().length() == 0 )
{
itemCodeTo = "";
System.out.println("Item Code to is Null...");
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString;
}
globalSingleLot = checkNull(genericUtility.getColumnValue("single_lot",headerDom));
globalMasterPackAllow = checkNull(genericUtility.getColumnValue("master_pack_allow",headerDom));
globalActivePickAllow = checkNull(genericUtility.getColumnValue("active_pick_allow",headerDom));
globalStockToDockAllow = checkNull(genericUtility.getColumnValue("stock_to_dock_allow",headerDom));
globalParcelPackAllow = checkNull(genericUtility.getColumnValue("parcelpack_allow",headerDom));
shipType = genericUtility.getColumnValue("ship_type",headerDom);
directPickLoc = genericUtility.getColumnValue("direct_pick_loc",headerDom);
printer = "";
printer = checkNull(genericUtility.getColumnValue("printer_name",headerDom));
printLabel = genericUtility.getColumnValue("print_label",headerDom);
getDataSql =" SELECT SORDER.CUST_CODE, CUSTOMER.CUST_NAME,SORDDET.LINE_NO, "
+"SORDER.SALE_ORDER,SORDER.DUE_DATE,SORDITEM.ITEM_CODE,"
+"ITEM.DESCR,SORDITEM.QUANTITY,"
+"(SORDITEM.QUANTITY - SORDITEM.QTY_DESP - SORDITEM.QTY_ALLOC) PENDING_QUANTITY,"
+"SORDITEM.QTY_ALLOC,SORDDET.PACK_INSTR,"
+"SORDITEM.SITE_CODE,SORDITEM.EXP_LEV, "
+"SORDER.PART_QTY AS PART_QTY, CUSTOMER.SINGLE_LOT AS SINGLE_LOT, SORDITEM.MIN_SHELF_LIFE AS MIN_SHELF_LIFE "//Gulzar 5/13/2012
+" ,SORDER.ALLOC_FLAG AS ALLOC_FLAG , WAVE_TYPE.MASTER_PACK_ALLOW , WAVE_TYPE.ACTIVE_PICK_ALLOW , WAVE_TYPE.STOCK_TO_DOCK_ALLOW, WAVE_TYPE.PARCELPACK_ALLOW "
+" ,ITEM.UNIT AS UNIT_STD ,SORDDET.UNIT ORDER_UNIT,SORDDET.UNIT__STD AS UNIT__STD, SORDDET.CONV__QTY_STDUOM "
+" , SORDER.CUST_CODE__DLV, C.CUST_NAME AS CUST_DLV_NAME "
+"FROM SORDDET,SORDER,SORDITEM,CUSTOMER,ITEM , WAVE_TYPE,CUSTOMER C "
+"WHERE ( SORDER.SALE_ORDER = SORDDET.SALE_ORDER ) AND "
+"( SORDITEM.SALE_ORDER = SORDER.SALE_ORDER ) AND "
+"( SORDDET.LINE_NO = SORDITEM.LINE_NO ) AND "
+"( SORDITEM.ITEM_CODE = ITEM.ITEM_CODE ) AND "
+"( SORDER.CUST_CODE = CUSTOMER.CUST_CODE ) AND "
+"( SORDDET.SITE_CODE = SORDITEM.SITE_CODE ) AND "
+"( CUSTOMER.WAVE_TYPE = WAVE_TYPE.WAVE_TYPE(+)) AND "
+" SORDITEM.SITE_CODE = ? AND "
+" ITEM.ITEM_SER >=? AND "
+" ITEM.ITEM_SER <=? AND "
+" ITEM.ITEM_CODE >=? AND "
+" ITEM.ITEM_CODE <=? AND "
+" CUSTOMER.CUST_CODE >=? AND "
+" CUSTOMER.CUST_CODE <=? AND "
+" SORDER.CUST_CODE__DLV >=? AND "
+" SORDER.CUST_CODE__DLV <=? AND "
+" SORDER.SALE_ORDER >= ? AND "
+" SORDER.SALE_ORDER <= ? AND "
+" SORDER.DUE_DATE >= ? AND"
+" SORDER.DUE_DATE <= ? "
+" AND SORDER.CUST_CODE__DLV = C.CUST_CODE "
+" AND CASE WHEN SORDDET.STATUS IS NULL THEN 'P' ELSE SORDDET.STATUS end <> 'C' "
+" AND CASE WHEN SORDER.STATUS IS NULL THEN 'P' ELSE SORDER.STATUS end = 'P' "
+" AND CASE WHEN SORDDET.HOLD_FLAG IS NULL THEN 'N' ELSE SORDDET.HOLD_FLAG end <> 'Y'"
+" AND ((SORDITEM.QUANTITY - SORDITEM.QTY_DESP - SORDITEM.QTY_ALLOC > 0 ) "
+" OR (FN_CHECK_MANUAL_STOCK_ALLOC(SORDER.SALE_ORDER, SORDDET.LINE_NO) = 0 ) )"
+" AND SORDITEM.LINE_TYPE = 'I'"
+" ORDER BY SORDER.CUST_CODE,SORDER.SALE_ORDER,SORDITEM.ITEM_CODE__ORD";
resrvLoc = discommon.getDisparams("999999","RESERV_LOCATION",conn);
casePickLoc = discommon.getDisparams("999999","CASE_PICK_INVSTAT",conn);
activePickLoc = discommon.getDisparams("999999","ACTIVE_PICK_INVSTAT",conn);
deepStoreLoc = discommon.getDisparams("999999","DEEP_STORE_INVSTAT",conn);
partialResrvLoc = discommon.getDisparams("999999","PRSRV_INVSTAT",conn);
System.out.println("CASE_PICK_INVSTAT"+casePickLoc+"ACTIVE_PICK_INVSTAT"+activePickLoc+"RESERV_LOCATION"+resrvLoc+"PARTIAL RESERVE LOC["+partialResrvLoc+"]shipmentType["+shipType+"]");
pstmt = conn.prepareStatement(getDataSql);
pstmt.setString(1,siteCode);
pstmt.setString(2,itemSerFr);
pstmt.setString(3,itemSerTo);
pstmt.setString(4,itemCodeFr);
pstmt.setString(5,itemCodeTo);
pstmt.setString(6,custCodeFr);
pstmt.setString(7,custCodeTo);
pstmt.setString(8,custCodeDlvFr);
pstmt.setString(9,custCodeDlvTo);
pstmt.setString(10,saleOrderFr);
pstmt.setString(11,saleOrderTo);
pstmt.setTimestamp(12,dateFr);
pstmt.setTimestamp(13,dateTo);
st = conn.createStatement();
rs = pstmt.executeQuery();
sSQL = "SELECT SUM(STOCK.QUANTITY - STOCK.ALLOC_QTY - (CASE WHEN STOCK.HOLD_QTY IS NULL THEN 0 ELSE STOCK.HOLD_QTY END ) ), SUM(STOCK.HOLD_QTY ) "
+"FROM STOCK,ITEM,LOCATION,INVSTAT "
+"WHERE (ITEM.ITEM_CODE = STOCK.ITEM_CODE) "
+"AND (LOCATION.LOC_CODE = STOCK.LOC_CODE ) "
+"AND (LOCATION.INV_STAT = INVSTAT.INV_STAT) "
+"AND INVSTAT.AVAILABLE = ? "
+"AND STOCK.ITEM_CODE = ? "
+"AND STOCK.SITE_CODE = ? "
+"AND (STOCK.QUANTITY - STOCK.ALLOC_QTY - CASE WHEN STOCK.HOLD_QTY IS NULL THEN 0 ELSE STOCK.HOLD_QTY END) > 0 "
+"AND (MONTHS_BETWEEN(TO_DATE(STOCK.EXP_DATE),SYSDATE) > ? ) ";
sSingleLotSql = "SELECT SUM(STOCK.QUANTITY - STOCK.ALLOC_QTY - (CASE WHEN STOCK.HOLD_QTY IS NULL THEN 0 ELSE STOCK.HOLD_QTY END ) ), "
+"SUM(STOCK.HOLD_QTY ) "
+"FROM STOCK,ITEM,LOCATION,INVSTAT "
+"WHERE (ITEM.ITEM_CODE = STOCK.ITEM_CODE) "
+"AND (LOCATION.LOC_CODE = STOCK.LOC_CODE ) "
+"AND (LOCATION.INV_STAT = INVSTAT.INV_STAT) "
+"AND INVSTAT.AVAILABLE = ? "
+"AND STOCK.ITEM_CODE = ? "
+"AND STOCK.SITE_CODE = ? "
+"AND STOCK.LOT_NO IN (SELECT LOT_NO FROM STOCK WHERE ITEM_CODE =? AND SITE_CODE =? "
+"GROUP BY LOT_NO HAVING SUM(QUANTITY - ALLOC_QTY - (CASE WHEN STOCK.HOLD_QTY IS NULL THEN 0 ELSE STOCK.HOLD_QTY END) ) >= ?) "
+"AND (MONTHS_BETWEEN(TO_DATE(STOCK.EXP_DATE),SYSDATE) > ? ) ";
sqlTran = "SELECT TRAN_NAME FROM TRANSPORTER WHERE TRAN_CODE = ?";
int count = 0;
String partQty = "";
String singleLot = "";
String itemCode = "";
String siteCode = "";
int minSelfLife = 0;
ResultSet rsStock = null;
double pendingQty = 0d;
boolean isActives = false;
sqlFnManual = " SELECT FN_MANUAL_STOCK_FOR_EACHITEM(?,?) AS ALLOC_FLAG FROM DUAL";
pstmtManul = conn.prepareStatement(sqlFnManual);
sqlTotHoldQty = "SELECT SUM(HOLD_QTY) AS HOLD_QTY FROM STOCK WHERE ITEM_CODE = ? AND SITE_CODE = ?";
pstmtHold = conn.prepareStatement(sqlTotHoldQty);
sqlManQty = "SELECT SUM(QTY_ALLOC) AS MAN_QTY FROM SORDALLOC WHERE SALE_ORDER = ? AND LINE_NO = ? " +
"AND (CASE WHEN WAVE_FLAG IS NULL THEN 'N' ELSE WAVE_FLAG END) = 'N'";
pstmtManQty = conn.prepareStatement(sqlManQty);
if(rs.next())
{
do
{
minSelfLife = 0;
orderByStkStr = "";
tranName = "";
isActives = false;
pendingQty = rs.getDouble("PENDING_QUANTITY");
itemCode = checkNull(rs.getString(6));
siteCode = checkNull(rs.getString(12));
partQty = checkNull(rs.getString("PART_QTY"));
singleLot = checkNull(rs.getString("SINGLE_LOT"));
minSelfLife = rs.getInt("MIN_SHELF_LIFE");
masterPackAllow = checkNull(rs.getString("MASTER_PACK_ALLOW"));
activePickAllow =checkNull( rs.getString("ACTIVE_PICK_ALLOW"));
stockToDockAllow = checkNull(rs.getString("STOCK_TO_DOCK_ALLOW"));
parcelPackAllow = checkNull(rs.getString("PARCELPACK_ALLOW"));
System.out.println("masterPackAllow ["+masterPackAllow+"] activePickAllow ["+activePickAllow+"] stockToDockAllow ["+stockToDockAllow+"]parcelPackAllow ["+parcelPackAllow+"]");
mbaseUnit = checkNull(rs.getString("UNIT_STD"));
unit = checkNull(rs.getString("ORDER_UNIT"));
unitStd = checkNull(rs.getString("UNIT__STD"));
convQtyStduom = rs.getDouble("CONV__QTY_STDUOM");
System.out.println(" first mbaseUnit ["+mbaseUnit+"] unit ["+unit+"] unitStd ["+unitStd+"] convQtyStduom ["+convQtyStduom+"]");
if(unitStd != "")
{
mbaseUnit = unitStd;
}
quantity = rs.getDouble(8);
if(!unit.equalsIgnoreCase(mbaseUnit))
{
if(convQtyStduom != 0)
{
convFact = convQtyStduom;
}
ArrayList convQtyList = discommon.getConvQuantityFact(unit, mbaseUnit, itemCode, pendingQty, convFact,conn);
System.out.println("convQtyList = "+convQtyList);
meffQty = Double.parseDouble(convQtyList.get(1).toString());
System.out.println("meffQty ["+meffQty+"]");
if(meffQty == -999999999)
{
meffQty = 0;
}
if (convQtyStduom == 0)
{
convQtyStduom= Double.parseDouble(convQtyList.get(0).toString());
}
pendingQty = meffQty;
convQtyList = new ArrayList();
convQtyList = discommon.getConvQuantityFact(unit, mbaseUnit, itemCode, quantity, convFact,conn);
quantity = Double.parseDouble(convQtyList.get(1).toString());
System.out.println("quantity ["+quantity+"]");
if(quantity == -999999999)
{
quantity = 0;
}
}
System.out.println("pendingQty =["+pendingQty+"]");
System.out.println("partQty =["+partQty+"]");
System.out.println("singleLot =["+singleLot+"]");
System.out.println("MIN_SHELF_LIFE =["+minSelfLife+"]");
HashMap itemVolMap = getItemVoumeMap(itemCode, "", conn);
double packSize = (Double)itemVolMap.get("PACK_SIZE");
double itemWeight = (Double)itemVolMap.get("ITEM_WEIGHT");
System.out.println("itemWeight =["+itemWeight+"]");
double noArt = pendingQty/packSize;
getTranInfo = new HashMap();
saleOrderTran = rs.getString("SALE_ORDER");
if("Y".equalsIgnoreCase(globalMasterPackAllow))
{
pickType = "M";
}
else if("Y".equalsIgnoreCase(globalParcelPackAllow))
{
pickType = "P";
}
getTranInfo = getTransporterInfoMap(saleOrderTran, itemWeight * pendingQty, noArt, pickType, shipType, conn);
tranCod = (String)getTranInfo.get("TRAN_CODE");
docLocation = getDocLoc(tranCod, conn);
pstmtTran = conn.prepareStatement(sqlTran);
pstmtTran.setString(1,tranCod);
rsTran = pstmtTran.executeQuery();
if(rsTran.next())
{
tranName = rsTran.getString("TRAN_NAME");
}
if(pstmtTran != null)
{
pstmtTran.close();
pstmtTran = null;
}
if(rsTran != null)
{
rsTran.close();
rsTran = null;
}
if(globalSingleLot != null && !globalSingleLot.equalsIgnoreCase(singleLot) && globalSingleLot.length() > 0)
{
singleLot = globalSingleLot;
}
if(directPickLoc != null && directPickLoc.length() > 0)
{
orderByStkStr = "AND LOCATION.LOC_CODE IN(?) ORDER BY STOCK.EXP_DATE,LOCATION.INV_STAT, STOCK.LOC_CODE ";
}
else
{
orderByStkStr = "AND LOCATION.INV_STAT IN(?,?,?,?,?) ORDER BY STOCK.EXP_DATE,LOCATION.INV_STAT, STOCK.LOC_CODE ";
}
if ( partQty.trim().length() > 0 )
{
System.out.println("in side if");
if( "2".equalsIgnoreCase(partQty))
{
partQtyValue = "Ship Available";
}
else if ("0".equalsIgnoreCase(partQty))
{
partQtyValue = "Ship Complete";
}
else if("1".equalsIgnoreCase(partQty))
{
partQtyValue = "Ship Complete Lines";
}
System.out.println("partQtyValue is --> ["+partQtyValue+"]");
}
if(itemCodeMap.containsKey(rs.getString(6)))
{
balStockQty = Double.parseDouble(itemCodeMap.get(rs.getString(6)).toString());
bappend = false ;
}
else
{
if(directPickLoc != null && directPickLoc.length() > 0)
{
pstmtStock = conn.prepareStatement(sSQL + orderByStkStr);
pstmtStock.setString(1,"Y");
pstmtStock.setString(2,rs.getString(6));
pstmtStock.setString(3,rs.getString(12));
pstmtStock.setInt(4,minSelfLife);
pstmtStock.setString(5,directPickLoc);
}
else if ( singleLot.trim().length() > 0 && singleLot.trim().equalsIgnoreCase("Y") )
{
pstmtStock = conn.prepareStatement(sSingleLotSql + orderByStkStr);
pstmtStock.setString(1,"Y");
pstmtStock.setString(2,itemCode);
pstmtStock.setString(3,siteCode);
pstmtStock.setString(4,itemCode);
pstmtStock.setString(5,siteCode);
pstmtStock.setDouble(6,pendingQty);
pstmtStock.setInt(7,minSelfLife);
pstmtStock.setString(8,resrvLoc);
pstmtStock.setString(9,casePickLoc);
pstmtStock.setString(10,activePickLoc);
pstmtStock.setString(11,deepStoreLoc);
pstmtStock.setString(12,partialResrvLoc);
}
else
{
//sSQL = sSQL + orderByStkStr;
pstmtStock = conn.prepareStatement(sSQL + orderByStkStr);
pstmtStock.setString(1,"Y");
pstmtStock.setString(2,rs.getString(6));
pstmtStock.setString(3,rs.getString(12));
pstmtStock.setInt(4,minSelfLife);//Gulzar on 5/18/2012
pstmtStock.setString(5,resrvLoc);
pstmtStock.setString(6,casePickLoc);
pstmtStock.setString(7,activePickLoc);
pstmtStock.setString(8,deepStoreLoc);
pstmtStock.setString(9,partialResrvLoc);
}
rs1 = pstmtStock.executeQuery();
if (rs1.next())
{
bappend = true;
balStockQty = rs1.getDouble(1);
holdQty = rs1.getDouble(2);
itemCodeMap.put(rs.getString(6),new Double(rs1.getDouble(1)));
System.out.println("Bal stk qty for item ....." + rs.getString(6) + " is " + balStockQty);
}
if(rs1 != null)
{
rs1.close();
}
pstmtStock.clearParameters();
}
double itemStkQty = 0d;
if(itemCodeMap.containsKey(rs.getString(6)))
{
itemStkQty = (Double)itemCodeMap.get(rs.getString(6));
System.out.println("balStockQty =["+itemStkQty+"]");
retTabSepStrBuff.append( "<Detail2>\r\n" );
retTabSepStrBuff.append( "<cust_code><![CDATA[" ).append(rs.getString(1)).append( "]]></cust_code>\r\n" );
retTabSepStrBuff.append( "<cust_name><![CDATA[" ).append(rs.getString(2)).append( "]]></cust_name>\r\n" );
retTabSepStrBuff.append( "<line_no><![CDATA[" ).append(rs.getString(3)).append( "]]></line_no>\r\n" );
retTabSepStrBuff.append( "<sale_order><![CDATA[" ).append(rs.getString(4)).append( "]]></sale_order>\r\n" );
System.out.println("Due Date Format===>>>>>>>>=="+rs.getDate(5));
retTabSepStrBuff.append( "<due_date><![CDATA[" ).append(rs.getDate(5)).append( "]]></due_date>\r\n" );
dueDate = rs.getTimestamp(5);
retTabSepStrBuff.append( "<item_code><![CDATA[" ).append(rs.getString(6)).append( "]]></item_code>\r\n" );
retTabSepStrBuff.append( "<item_descr><![CDATA[" ).append(rs.getString(7)).append( "]]></item_descr>\r\n" );
if (globalSingleLot.trim().length() > 0)
{
retTabSepStrBuff.append( "<single_lot><![CDATA[" ).append(globalSingleLot).append( "]]></single_lot>\r\n" );
retTabSepStrBuff.append( "<master_pack_allow><![CDATA[" ).append(globalMasterPackAllow).append( "]]></master_pack_allow>\r\n" );
retTabSepStrBuff.append( "<active_pick_allow><![CDATA[" ).append(globalActivePickAllow).append( "]]></active_pick_allow>\r\n" );
retTabSepStrBuff.append( "<stock_to_dock_allow><![CDATA[" ).append(globalStockToDockAllow).append( "]]></stock_to_dock_allow>\r\n" );
retTabSepStrBuff.append( "<parcelpack_allow><![CDATA[" ).append(globalParcelPackAllow).append( "]]></parcelpack_allow>\r\n" );
}
else
{
retTabSepStrBuff.append( "<single_lot><![CDATA[" ).append(singleLot).append( "]]></single_lot>\r\n" );
retTabSepStrBuff.append( "<master_pack_allow><![CDATA[" ).append(masterPackAllow).append( "]]></master_pack_allow>\r\n" );
retTabSepStrBuff.append( "<active_pick_allow><![CDATA[" ).append(activePickAllow).append( "]]></active_pick_allow>\r\n" );
retTabSepStrBuff.append( "<stock_to_dock_allow><![CDATA[" ).append(stockToDockAllow).append( "]]></stock_to_dock_allow>\r\n" );
retTabSepStrBuff.append( "<parcelpack_allow><![CDATA[" ).append(parcelPackAllow).append( "]]></parcelpack_allow>\r\n" );
}
retTabSepStrBuff.append( "<ship_type><![CDATA[" ).append(shipType).append( "]]></ship_type>\r\n" );
retTabSepStrBuff.append( "<quantity><![CDATA[" ).append(quantity).append( "]]></quantity>\r\n" );
retTabSepStrBuff.append( "<part_qty><![CDATA[" ).append(partQtyValue).append( "]]></part_qty>\r\n" );
retTabSepStrBuff.append( "<pending_quantity><![CDATA[" ).append(pendingQty).append( "]]></pending_quantity>\r\n" );
pendQty = pendingQty;
balStockQtyTemp = balStockQty;
if (bappend == true)
{
retTabSepStrBuff.append( "<stock_quantity><![CDATA[" ).append(balStockQty).append( "]]></stock_quantity>\r\n" );
}
else
{
retTabSepStrBuff.append( "<stock_quantity><![CDATA[" ).append("0.0").append( "]]></stock_quantity>\r\n" );
}
pstmtManul.setString(1,saleOrderTran);
pstmtManul.setString(2,rs.getString(3));
rsMan = pstmtManul.executeQuery();
if(rsMan.next())
{
allocFlag = rsMan.getString("ALLOC_FLAG");
}
if ("M".equalsIgnoreCase(allocFlag))
{
allocFlag = allocFlag;
}
else
{
allocFlag = "";
}
pstmtManul.clearParameters();
if(balStockQty >= pendQty)
{
allocQty = pendQty;
balStockQty -= pendQty;
}
else
{
allocQty = balStockQty;
balStockQty = 0;
}
if(DefaultQtyFlag.equals("Y") && !"M".equalsIgnoreCase(allocFlag))
{
retTabSepStrBuff.append( "<qty_alloc><![CDATA[" ).append(allocQty).append( "]]></qty_alloc>\r\n" );
}
else
{
retTabSepStrBuff.append( "<qty_alloc><![CDATA[" ).append("0.0").append( "]]></qty_alloc>\r\n" );
}
pstmtHold.setString(1, itemCode);
pstmtHold.setString(2, siteCode);
rsHld = pstmtHold.executeQuery();
if(rsHld.next())
{
retTabSepStrBuff.append( "<hold_qty><![CDATA[" ).append(rsHld.getDouble(1)).append( "]]></hold_qty>\r\n" );
}
pstmtHold.clearParameters();
itemCodeMap.put(rs.getString(6), new Double(balStockQty));
sordItemQty= rs.getDouble(8);
balStk = balStockQtyTemp - pendQty ;
System.out.println("balStk ::"+balStk);
if(balStk >= 0)
{
retTabSepStrBuff.append( "<bal_qty><![CDATA[" ).append(balStk).append( "]]></bal_qty>\r\n" );
}
else
{
retTabSepStrBuff.append( "<bal_qty><![CDATA[" ).append("0.0").append( "]]></bal_qty>\r\n" );
}
pstmtManQty.setString(1, saleOrderTran);
pstmtManQty.setString(2, rs.getString(3));
rsM = pstmtManQty.executeQuery();
if( rsM.next())
{
retTabSepStrBuff.append( "<manual_allocqty><![CDATA[" ).append((rsM.getString("MAN_QTY") == null) ? "0.0" :rsM.getString("MAN_QTY")).append( "]]></manual_allocqty>\r\n" );
}
else
{
retTabSepStrBuff.append( "<manual_allocqty><![CDATA[" ).append("0.0").append( "]]></manual_allocqty>\r\n" );
}
pstmtManQty.clearParameters();
if (allocFlag == null)
{
allocFlag = "";
}
public String getData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException retTabSepStrBuff.append( "<alloc_flag><![CDATA[" ).append(allocFlag).append( "]]></alloc_flag>\r\n" );
retTabSepStrBuff.append( "<tran_code><![CDATA[" ).append(tranCod).append( "]]></tran_code>\r\n" );
retTabSepStrBuff.append( "<tran_name><![CDATA[" ).append(tranName).append( "]]></tran_name>\r\n" );
retTabSepStrBuff.append( "<lock_code__dock><![CDATA[" ).append(docLocation).append( "]]></lock_code__dock>\r\n" );
packInstr = rs.getString(11);
if (packInstr == null)
{
packInstr = "";
}
retTabSepStrBuff.append( "<pack_instr><![CDATA[" ).append(packInstr).append( "]]></pack_instr>\r\n" );
retTabSepStrBuff.append( "<site_code><![CDATA[" ).append(rs.getString(12)).append( "]]></site_code>\r\n" );
retTabSepStrBuff.append( "<exp_lev><![CDATA[" ).append(rs.getString(13)).append( "]]></exp_lev>\r\n" );
retTabSepStrBuff.append( "<last_col><![CDATA[" ).append("").append( "]]></last_col>\r\n" );
retTabSepStrBuff.append( "<part_qty_real><![CDATA[" ).append(partQty).append( "]]></part_qty_real>\r\n" );
retTabSepStrBuff.append( "<cust_code__dlv><![CDATA[" ).append(checkNull(rs.getString("CUST_CODE__DLV"))).append( "]]></cust_code__dlv>\r\n" );
retTabSepStrBuff.append( "<customer_cust_name><![CDATA[" ).append(checkNull(rs.getString("CUST_DLV_NAME"))).append( "]]></customer_cust_name>\r\n" );
retTabSepStrBuff.append( "</Detail2>\r\n" );
}
}while(rs.next());
retTabSepStrBuff.append( "</Header0>\r\n</group0>\r\n</DocumentRoot>\r\n" );
resultString = retTabSepStrBuff.toString();
System.out.println("ResultString....." + resultString);
pstmt.clearParameters();
}
else
{
errCode ="VTNOREC2";
}
if (!errCode.equals(""))
{
resultString = itmDBAccessEJB.getErrorString("", errCode, "", "", conn);
System.out.println("resultString: "+resultString);
}
if(st != null)
{
st.close();
st = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt=null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if(pstmtStock != null)
{
pstmtStock.close();
pstmtStock = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
if(rs2 != null)
{
rs2.close();
rs2 = null;
}
if(pstmtTran != null)
{
pstmtTran.close();
pstmtTran = null;
}
if(rsTran != null)
{
rsTran.close();
rsTran = null;
}
if(pstmtManul != null)
{
pstmtManul.close();
pstmtManul = null;
}
if( rsMan != null)
{
rsMan.close();
rsMan = null;
}
if(rsHld != null)
{
rsHld.close();
rsHld = null;
}
if(pstmtHold != null)
{
pstmtHold.close();
pstmtHold = null;
}
if(pstmtManQty != null)
{
pstmtManQty.close();
pstmtManQty = null;
}
if( rsM != null)
{
rsM.close();
rsM = null;
}
}
catch (SQLException e)
{
System.out.println("SQLException :StockAllocationPrcEJB :getData(Document headerDom, Document detailDom, String windowName, String xtraParams):" + e.getMessage() + ":");
throw new ITMException(e);
}
catch (Exception e)
{
System.out.println("Exception :StockAllocationPrcEJB :getData(Document headerDom, Document detailDom, String windowName, String xtraParams):" + e.getMessage() + ":");
throw new ITMException(e);
}
finally
{
cleanup();
try
{
retTabSepStrBuff = null;
if(conn != null)
{
if(st != null)
{
st.close();
st = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
if(rs2 != null)
{
rs2.close();
rs2 = null;
}
if(rsTran != null)
{
rsTran.close();
rsTran = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt=null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if(pstmtStock != null)
{
pstmtStock.close();
pstmtStock = null;
}
if(pstmtTran != null)
{
pstmtTran.close();
pstmtTran = null;
}
if(rsTran != null)
{
rsTran.close();
rsTran = null;
}
if(pstmtManul != null)
{
pstmtManul.close();
pstmtManul = null;
}
if( rsMan != null)
{
rsMan.close();
rsMan = null;
}
if(rsHld != null)
{
rsHld.close();
rsHld = null;
}
if(pstmtHold != null)
{
pstmtHold.close();
pstmtHold = null;
}
if(pstmtManQty != null)
{
pstmtManQty.close();
pstmtManQty = null;
}
if( rsM != null)
{
rsM.close();
rsM = null;
}
conn.close();
conn = null;
}
}
catch(Exception e)
{
errString = e.getMessage();
e.printStackTrace();
throw new ITMException(e);
}
}
return resultString;
}
/*public String getData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException
{ {
String errCode = ""; String errCode = "";
...@@ -307,7 +1215,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -307,7 +1215,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
connDriver = null; connDriver = null;
//retTabSepStrBuff.append("</Header>\r\n" ); //retTabSepStrBuff.append("</Header>\r\n" );
/*//Changed by Rohan 29-12-11 to consider only RESERV, CASE PICK AND ACTIVE PICK LOCATIONS //Changed by Rohan 29-12-11 to consider only RESERV, CASE PICK AND ACTIVE PICK LOCATIONS
//Changed by Rohan 0n 18/01/12 as said by gulzar sir //Changed by Rohan 0n 18/01/12 as said by gulzar sir
//resrvLoc = discommon.getDisparams("999999","RESERV_LOCATION",conn); //resrvLoc = discommon.getDisparams("999999","RESERV_LOCATION",conn);
resrvLoc = discommon.getDisparams("999999","RESERV_LOCATION",conn); resrvLoc = discommon.getDisparams("999999","RESERV_LOCATION",conn);
...@@ -319,7 +1227,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -319,7 +1227,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
System.out.println("CASE_PICK_INVSTAT"+casePickLoc+"ACTIVE_PICK_INVSTAT"+activePickLoc+"RESERV_LOCATION"+resrvLoc+"PARTIAL RESERVE LOC["+partialResrvLoc+"]"); System.out.println("CASE_PICK_INVSTAT"+casePickLoc+"ACTIVE_PICK_INVSTAT"+activePickLoc+"RESERV_LOCATION"+resrvLoc+"PARTIAL RESERVE LOC["+partialResrvLoc+"]");
//Changed by Rohan 29-12-11 .end //Changed by Rohan 29-12-11 .end
*/
siteCode = genericUtility.getColumnValue("site_code",headerDom); siteCode = genericUtility.getColumnValue("site_code",headerDom);
if ( siteCode == null || siteCode.trim().length() == 0 ) if ( siteCode == null || siteCode.trim().length() == 0 )
{ {
...@@ -330,7 +1238,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -330,7 +1238,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
} }
System.out.println("SITE CODE ::"+ siteCode); System.out.println("SITE CODE ::"+ siteCode);
postOrderFg = "N"; postOrderFg = "N";
/*
postOrderFg = genericUtility.getColumnValue("post_order_flag",headerDom); postOrderFg = genericUtility.getColumnValue("post_order_flag",headerDom);
if(postOrderFg == null || postOrderFg.trim().length() == 0) if(postOrderFg == null || postOrderFg.trim().length() == 0)
{ {
...@@ -339,7 +1247,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -339,7 +1247,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn); errString = itmDBAccessEJB.getErrorString("","VTMRPPARM","","",conn);
return errString; return errString;
} }
*/
System.out.println("postOrderFg ::"+ postOrderFg); System.out.println("postOrderFg ::"+ postOrderFg);
itemSerFr = genericUtility.getColumnValue("item_ser__from",headerDom); itemSerFr = genericUtility.getColumnValue("item_ser__from",headerDom);
if ( itemSerFr == null || itemSerFr.trim().length() == 0 ) if ( itemSerFr == null || itemSerFr.trim().length() == 0 )
...@@ -475,8 +1383,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -475,8 +1383,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
shipType = genericUtility.getColumnValue("ship_type",headerDom); shipType = genericUtility.getColumnValue("ship_type",headerDom);
directPickLoc = genericUtility.getColumnValue("direct_pick_loc",headerDom); directPickLoc = genericUtility.getColumnValue("direct_pick_loc",headerDom);
//Changed by sumit on 03/10/12 getting value of printer start //Changed by sumit on 03/10/12 getting value of printer start
/*printer = ""; printer = "";
printer = checkNull(genericUtility.getColumnValue("printer",headerDom));*/ printer = checkNull(genericUtility.getColumnValue("printer",headerDom));
//Changed by sumit on 03/10/12 getting value of printer start //Changed by sumit on 03/10/12 getting value of printer start
printer = ""; printer = "";
printer = checkNull(genericUtility.getColumnValue("printer_name",headerDom)); printer = checkNull(genericUtility.getColumnValue("printer_name",headerDom));
...@@ -488,7 +1396,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -488,7 +1396,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Changed by sumit on 03/10/12 getting value of printer end //Changed by sumit on 03/10/12 getting value of printer end
//Changed by Sumit sarkar on 07/03/12 search on the basis of item_code too. //Changed by Sumit sarkar on 07/03/12 search on the basis of item_code too.
/*getDataSql = "SELECT SORDER.CUST_CODE, CUSTOMER.CUST_NAME,SORDDET.LINE_NO, " getDataSql = "SELECT SORDER.CUST_CODE, CUSTOMER.CUST_NAME,SORDDET.LINE_NO, "
+"SORDER.SALE_ORDER,SORDER.DUE_DATE,SORDITEM.ITEM_CODE," +"SORDER.SALE_ORDER,SORDER.DUE_DATE,SORDITEM.ITEM_CODE,"
+"ITEM.DESCR,SORDITEM.QUANTITY," +"ITEM.DESCR,SORDITEM.QUANTITY,"
+"SORDITEM.QUANTITY - SORDITEM.QTY_DESP - SORDITEM.QTY_ALLOC PENDING_QUANTITY," +"SORDITEM.QUANTITY - SORDITEM.QTY_DESP - SORDITEM.QTY_ALLOC PENDING_QUANTITY,"
...@@ -514,8 +1422,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -514,8 +1422,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
+"AND CASE WHEN SORDER.STATUS IS NULL THEN 'P' ELSE SORDER.STATUS end = 'P' " +"AND CASE WHEN SORDER.STATUS IS NULL THEN 'P' ELSE SORDER.STATUS end = 'P' "
+"AND SORDITEM.QUANTITY - SORDITEM.QTY_DESP - SORDITEM.QTY_ALLOC > 0 " +"AND SORDITEM.QUANTITY - SORDITEM.QTY_DESP - SORDITEM.QTY_ALLOC > 0 "
+"AND SORDITEM.LINE_TYPE = 'I'" +"AND SORDITEM.LINE_TYPE = 'I'"
+"ORDER BY SORDER.CUST_CODE,SORDER.SALE_ORDER,SORDITEM.ITEM_CODE__ORD"; */ +"ORDER BY SORDER.CUST_CODE,SORDER.SALE_ORDER,SORDITEM.ITEM_CODE__ORD";
/*
//Changed by Chandni on 30/May/12 for cust_cod__dlv__from and cust_cod__dlv__from //Changed by Chandni on 30/May/12 for cust_cod__dlv__from and cust_cod__dlv__from
getDataSql = "SELECT SORDER.CUST_CODE, CUSTOMER.CUST_NAME,SORDDET.LINE_NO, " getDataSql = "SELECT SORDER.CUST_CODE, CUSTOMER.CUST_NAME,SORDDET.LINE_NO, "
+"SORDER.SALE_ORDER,SORDER.DUE_DATE,SORDITEM.ITEM_CODE," +"SORDER.SALE_ORDER,SORDER.DUE_DATE,SORDITEM.ITEM_CODE,"
...@@ -547,7 +1455,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -547,7 +1455,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
+"AND SORDITEM.QUANTITY - SORDITEM.QTY_DESP - SORDITEM.QTY_ALLOC > 0 " +"AND SORDITEM.QUANTITY - SORDITEM.QTY_DESP - SORDITEM.QTY_ALLOC > 0 "
+"AND SORDITEM.LINE_TYPE = 'I'" +"AND SORDITEM.LINE_TYPE = 'I'"
+"ORDER BY SORDER.CUST_CODE,SORDER.SALE_ORDER,SORDITEM.ITEM_CODE__ORD"; +"ORDER BY SORDER.CUST_CODE,SORDER.SALE_ORDER,SORDITEM.ITEM_CODE__ORD";
*/
getDataSql =" SELECT SORDER.CUST_CODE, CUSTOMER.CUST_NAME,SORDDET.LINE_NO, " getDataSql =" SELECT SORDER.CUST_CODE, CUSTOMER.CUST_NAME,SORDDET.LINE_NO, "
...@@ -666,14 +1574,14 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -666,14 +1574,14 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
+"AND SORDITEM.LINE_TYPE = 'I'" +"AND SORDITEM.LINE_TYPE = 'I'"
//Changed by Rohan on 11/07/12 revert Changes of Manual Stock Allocation.start //Changed by Rohan on 11/07/12 revert Changes of Manual Stock Allocation.start
/*
//Changed By Rohan on 22/06/12.start //Changed By Rohan on 22/06/12.start
+" AND (SORDITEM.SALE_ORDER , SORDITEM.LINE_NO) NOT IN (SELECT SALE_ORDER,LINE_NO__SORD FROM PICK_ORD_DET " +" AND (SORDITEM.SALE_ORDER , SORDITEM.LINE_NO) NOT IN (SELECT SALE_ORDER,LINE_NO__SORD FROM PICK_ORD_DET "
+" WHERE PICK_ORD_DET.SALE_ORDER =SORDITEM.SALE_ORDER AND PICK_ORD_DET.LINE_NO__SORD = SORDITEM.LINE_NO)" +" WHERE PICK_ORD_DET.SALE_ORDER =SORDITEM.SALE_ORDER AND PICK_ORD_DET.LINE_NO__SORD = SORDITEM.LINE_NO)"
+" AND (SORDITEM.SALE_ORDER , SORDITEM.LINE_NO) NOT IN (SELECT SALE_ORDER,LINE_NO__SORD FROM REPL_ORD_DET " +" AND (SORDITEM.SALE_ORDER , SORDITEM.LINE_NO) NOT IN (SELECT SALE_ORDER,LINE_NO__SORD FROM REPL_ORD_DET "
+" WHERE REPL_ORD_DET.SALE_ORDER = SORDITEM.SALE_ORDER AND REPL_ORD_DET.LINE_NO__SORD = SORDITEM.LINE_NO)" +" WHERE REPL_ORD_DET.SALE_ORDER = SORDITEM.SALE_ORDER AND REPL_ORD_DET.LINE_NO__SORD = SORDITEM.LINE_NO)"
//Chnged by Rohan on 22/06/12.end //Chnged by Rohan on 22/06/12.end
*/
//Changed by Rohan on 11/07/12 revert Changes of Manual Stock Allocation.end //Changed by Rohan on 11/07/12 revert Changes of Manual Stock Allocation.end
+" ORDER BY SORDER.CUST_CODE,SORDER.SALE_ORDER,SORDITEM.ITEM_CODE__ORD"; +" ORDER BY SORDER.CUST_CODE,SORDER.SALE_ORDER,SORDITEM.ITEM_CODE__ORD";
...@@ -759,14 +1667,14 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -759,14 +1667,14 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
int minSelfLife = 0; int minSelfLife = 0;
ResultSet rsStock = null; ResultSet rsStock = null;
/*String stkSql = "SELECT COUNT(*) AS COUNT, LOT_NO FROM STOCK WHERE ITEM_CODE = ? AND SITE_CODE = ? "+ String stkSql = "SELECT COUNT(*) AS COUNT, LOT_NO FROM STOCK WHERE ITEM_CODE = ? AND SITE_CODE = ? "+
"GROUP BY LOT_NO HAVING SUM(QUANTITY - ALLOC_QTY - (CASE WHEN HOLD_QTY IS NULL THEN 0 ELSE STOCK.HOLD_QTY END) ) >= ? "; "GROUP BY LOT_NO HAVING SUM(QUANTITY - ALLOC_QTY - (CASE WHEN HOLD_QTY IS NULL THEN 0 ELSE STOCK.HOLD_QTY END) ) >= ? ";
pstmtStock1 = conn.prepareStatement(stkSql);*/ pstmtStock1 = conn.prepareStatement(stkSql);
double pendingQty = 0d; double pendingQty = 0d;
//End changes by gulzar on 5/13/2012 //End changes by gulzar on 5/13/2012
boolean isActives = false; boolean isActives = false;
/*retTabSepStrBuff.append( "<?xml version='1.0' encoding='UTF-8'?><DocumentRoot><description>Datawindow Root</description><group0>" + retTabSepStrBuff.append( "<?xml version='1.0' encoding='UTF-8'?><DocumentRoot><description>Datawindow Root</description><group0>" +
"<description>Groupscription</description><Header0><description>Header0 members</description>\r\n" );*/ "<description>Groupscription</description><Header0><description>Header0 members</description>\r\n" );
if(rs.next()) if(rs.next())
{ {
do do
...@@ -887,8 +1795,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -887,8 +1795,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
rsTran = null; rsTran = null;
} }
/*HashMap itemVolMap = getItemVoumeMap(itemCode, "", conn); HashMap itemVolMap = getItemVoumeMap(itemCode, "", conn);
double packSize = (Double)itemVolMap.get("PACK_SIZE");*/ double packSize = (Double)itemVolMap.get("PACK_SIZE");
//if(globalSingleLot != null && !globalSingleLot.equalsIgnoreCase(singleLot)) //if(globalSingleLot != null && !globalSingleLot.equalsIgnoreCase(singleLot))
...@@ -899,7 +1807,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -899,7 +1807,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Changed By Pragyan 17/01/13 To get all data for stock.start //Changed By Pragyan 17/01/13 To get all data for stock.start
/*if((pendingQty % packSize) > 0) if((pendingQty % packSize) > 0)
{ {
isActives = true; isActives = true;
orderByStkStr = "AND LOCATION.INV_STAT IN(?,?,?,?,?) ORDER BY STOCK.EXP_DATE,LOCATION.INV_STAT, STOCK.LOC_CODE "; orderByStkStr = "AND LOCATION.INV_STAT IN(?,?,?,?,?) ORDER BY STOCK.EXP_DATE,LOCATION.INV_STAT, STOCK.LOC_CODE ";
...@@ -908,7 +1816,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -908,7 +1816,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
{ {
isActives = false; isActives = false;
orderByStkStr = "AND LOCATION.INV_STAT IN(?,?,?,?) ORDER BY STOCK.EXP_DATE, STOCK.LOC_CODE "; orderByStkStr = "AND LOCATION.INV_STAT IN(?,?,?,?) ORDER BY STOCK.EXP_DATE, STOCK.LOC_CODE ";
}*/ }
//if(directPickLoc.length() > 0) //if(directPickLoc.length() > 0)
if(directPickLoc != null && directPickLoc.length() > 0) if(directPickLoc != null && directPickLoc.length() > 0)
{ {
...@@ -922,7 +1830,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -922,7 +1830,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Change by Rohan Bhogale on 19/07/12 To display transporte details.end //Change by Rohan Bhogale on 19/07/12 To display transporte details.end
//Setting of parameters //Setting of parameters
/*pstmtStock1.setString(1,itemCode); pstmtStock1.setString(1,itemCode);
pstmtStock1.setString(2,siteCode); pstmtStock1.setString(2,siteCode);
pstmtStock1.setDouble(3,pendingQty); pstmtStock1.setDouble(3,pendingQty);
...@@ -934,11 +1842,11 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -934,11 +1842,11 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
if ( singleLot.trim().length() > 0 && singleLot.trim().equalsIgnoreCase("Y") && (count <= 0) ) if ( singleLot.trim().length() > 0 && singleLot.trim().equalsIgnoreCase("Y") && (count <= 0) )
{ {
continue; continue;
}*/ }
//Changed by sumit sarkar on 22/06/12 on the basis of part quntity it display condition STRAT. //Changed by sumit sarkar on 22/06/12 on the basis of part quntity it display condition STRAT.
/*if ( partQty.trim().length() > 0 && partQty.trim().equalsIgnoreCase("Y") ) if ( partQty.trim().length() > 0 && partQty.trim().equalsIgnoreCase("Y") )
{ {
}*/ }
...@@ -976,7 +1884,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -976,7 +1884,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
} }
else else
{ {
/*sql ="SELECT SUM(STOCK.QUANTITY - STOCK.ALLOC_QTY ) " sql ="SELECT SUM(STOCK.QUANTITY - STOCK.ALLOC_QTY ) "
+"FROM STOCK,ITEM,LOCATION,INVSTAT " +"FROM STOCK,ITEM,LOCATION,INVSTAT "
+"WHERE (ITEM.ITEM_CODE = STOCK.ITEM_CODE) " +"WHERE (ITEM.ITEM_CODE = STOCK.ITEM_CODE) "
+"AND (LOCATION.LOC_CODE = STOCK.LOC_CODE ) " +"AND (LOCATION.LOC_CODE = STOCK.LOC_CODE ) "
...@@ -985,10 +1893,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -985,10 +1893,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
+"AND STOCK.ITEM_CODE = '"+ rs.getString(6) + "'" +"AND STOCK.ITEM_CODE = '"+ rs.getString(6) + "'"
+"AND STOCK.SITE_CODE = '"+ rs.getString(12) +"'" +"AND STOCK.SITE_CODE = '"+ rs.getString(12) +"'"
+"AND (STOCK.QUANTITY - STOCK.ALLOC_QTY) > 0 "; +"AND (STOCK.QUANTITY - STOCK.ALLOC_QTY) > 0 ";
*/
//Changed by Rohan on 29-12-11 as said by gulzar sir.start //Changed by Rohan on 29-12-11 as said by gulzar sir.start
/*pstmtStock.setString(1,"Y"); pstmtStock.setString(1,"Y");
pstmtStock.setString(2,rs.getString(6)); pstmtStock.setString(2,rs.getString(6));
pstmtStock.setString(3,rs.getString(12)); pstmtStock.setString(3,rs.getString(12));
pstmtStock.setInt(4,minSelfLife);//Gulzar on 5/18/2012 pstmtStock.setInt(4,minSelfLife);//Gulzar on 5/18/2012
...@@ -997,7 +1905,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -997,7 +1905,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtStock.setString(7,activePickLoc); pstmtStock.setString(7,activePickLoc);
pstmtStock.setString(8,deepStoreLoc); pstmtStock.setString(8,deepStoreLoc);
//Changed by Rohan on 29-12-11 as said by gulzar sir.end //Changed by Rohan on 29-12-11 as said by gulzar sir.end
*/
if(directPickLoc != null && directPickLoc.length() > 0) if(directPickLoc != null && directPickLoc.length() > 0)
{ {
pstmtStock = conn.prepareStatement(sSQL + orderByStkStr); pstmtStock = conn.prepareStatement(sSQL + orderByStkStr);
...@@ -1023,10 +1931,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1023,10 +1931,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtStock.setString(10,activePickLoc); pstmtStock.setString(10,activePickLoc);
pstmtStock.setString(11,deepStoreLoc); pstmtStock.setString(11,deepStoreLoc);
pstmtStock.setString(12,partialResrvLoc); pstmtStock.setString(12,partialResrvLoc);
/*if(isActives) if(isActives)
{ {
pstmtStock.setString(12,partialResrvLoc); pstmtStock.setString(12,partialResrvLoc);
}*/ }
} }
else else
{ {
...@@ -1041,10 +1949,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1041,10 +1949,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtStock.setString(7,activePickLoc); pstmtStock.setString(7,activePickLoc);
pstmtStock.setString(8,deepStoreLoc); pstmtStock.setString(8,deepStoreLoc);
pstmtStock.setString(9,partialResrvLoc); pstmtStock.setString(9,partialResrvLoc);
/*if(isActives) if(isActives)
{ {
pstmtStock.setString(9,partialResrvLoc); pstmtStock.setString(9,partialResrvLoc);
}*/ }
//Changed by Rohan on 29-12-11 as said by gulzar sir.end //Changed by Rohan on 29-12-11 as said by gulzar sir.end
} }
rs1 = pstmtStock.executeQuery(); rs1 = pstmtStock.executeQuery();
...@@ -1056,10 +1964,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1056,10 +1964,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//CHanged by sumit sarkar getting hold quantity //CHanged by sumit sarkar getting hold quantity
holdQty = rs1.getDouble(2); holdQty = rs1.getDouble(2);
//Changed by sumit sarkar comment this for displaying zero item quantity //Changed by sumit sarkar comment this for displaying zero item quantity
/*if (balStockQty > 0) if (balStockQty > 0)
{ {
itemCodeMap.put(rs.getString(6),new Double(rs1.getDouble(1))); itemCodeMap.put(rs.getString(6),new Double(rs1.getDouble(1)));
}*/ }
itemCodeMap.put(rs.getString(6),new Double(rs1.getDouble(1))); itemCodeMap.put(rs.getString(6),new Double(rs1.getDouble(1)));
System.out.println("Bal stk qty for item ....." + rs.getString(6) + " is " + balStockQty); System.out.println("Bal stk qty for item ....." + rs.getString(6) + " is " + balStockQty);
...@@ -1082,11 +1990,11 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1082,11 +1990,11 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
retTabSepStrBuff.append( "<Detail2>\r\n" ); retTabSepStrBuff.append( "<Detail2>\r\n" );
//Changed by Gulzar on 5/13/2012 //Changed by Gulzar on 5/13/2012
//Changed by sumit sarkar on 22/06/12 comment this( now also displaying 0 stock quantity. start. //Changed by sumit sarkar on 22/06/12 comment this( now also displaying 0 stock quantity. start.
/*if ( partQty.trim().length() > 0 && partQty.trim().equalsIgnoreCase("N") && balStockQty < pendingQty ) if ( partQty.trim().length() > 0 && partQty.trim().equalsIgnoreCase("N") && balStockQty < pendingQty )
{ {
itemCodeMap.remove(rs.getString(6)); itemCodeMap.remove(rs.getString(6));
continue; continue;
}*/ }
//Changed by sumit sarkar on 22/06/12 comment this( now also displaying 0 stock quantity. end. //Changed by sumit sarkar on 22/06/12 comment this( now also displaying 0 stock quantity. end.
//End changed by Gulzar on 5/13/2012 //End changed by Gulzar on 5/13/2012
//CUST_CODE //CUST_CODE
...@@ -1125,7 +2033,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1125,7 +2033,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Changed by sumit on 20/08/12 to add single lot opt AND WAVE TYPES. start //Changed by sumit on 20/08/12 to add single lot opt AND WAVE TYPES. start
//Changed by sumit on 18/09/12 getting value from header field in case data start //Changed by sumit on 18/09/12 getting value from header field in case data start
/*//SINGLE LOT //SINGLE LOT
retTabSepStrBuff.append(singleLot).append("\t"); retTabSepStrBuff.append(singleLot).append("\t");
//MASTER_PACK_ALLOW //MASTER_PACK_ALLOW
...@@ -1135,7 +2043,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1135,7 +2043,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
retTabSepStrBuff.append(activePickAllow).append("\t"); retTabSepStrBuff.append(activePickAllow).append("\t");
//STOCK_TO_DOCK_ALLOW //STOCK_TO_DOCK_ALLOW
retTabSepStrBuff.append(stockToDockAllow).append("\t");*/ retTabSepStrBuff.append(stockToDockAllow).append("\t");
//Changed by sumit on 18/09/12 //Changed by sumit on 18/09/12
if (globalSingleLot.trim().length() > 0) if (globalSingleLot.trim().length() > 0)
{ {
...@@ -1194,7 +2102,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1194,7 +2102,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Chnaged by sumit on 20/08/12 commented this . going to display below. start. //Chnaged by sumit on 20/08/12 commented this . going to display below. start.
//Changed by rohan on 19/07/12 to add transporter details.start //Changed by rohan on 19/07/12 to add transporter details.start
/*//Tran Code //Tran Code
retTabSepStrBuff.append(tranCod).append("\t"); retTabSepStrBuff.append(tranCod).append("\t");
//Tran descr //Tran descr
...@@ -1202,7 +2110,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1202,7 +2110,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//LOCK_CODE_DOCK //LOCK_CODE_DOCK
retTabSepStrBuff.append(docLocation).append("\t"); retTabSepStrBuff.append(docLocation).append("\t");
*/
//Chnaged by sumit on 20/08/12 commented this . going to display below. end. //Chnaged by sumit on 20/08/12 commented this . going to display below. end.
//Changed by rohan on 19/07/12 to add transporter details.end //Changed by rohan on 19/07/12 to add transporter details.end
...@@ -1318,7 +2226,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1318,7 +2226,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Changed by sumit sarkar on 22/06/12 to display hold quantity.start //Changed by sumit sarkar on 22/06/12 to display hold quantity.start
// HOLD_QUANTITY // HOLD_QUANTITY
/*if (bappend == true) if (bappend == true)
{ {
//Changed by sankara on 23/11/12 append hold_qty in porpar format //Changed by sankara on 23/11/12 append hold_qty in porpar format
//retTabSepStrBuff.append(holdQty).append("\t"); //retTabSepStrBuff.append(holdQty).append("\t");
...@@ -1333,7 +2241,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1333,7 +2241,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//retTabSepStrBuff.append("0.0").append("\t"); //retTabSepStrBuff.append("0.0").append("\t");
retTabSepStrBuff.append( "<hold_qty><![CDATA[" ).append("0.0").append( "]]></hold_qty>\r\n" ); retTabSepStrBuff.append( "<hold_qty><![CDATA[" ).append("0.0").append( "]]></hold_qty>\r\n" );
} }
*/
sql = "SELECT SUM(HOLD_QTY) AS HOLD_QTY FROM STOCK WHERE ITEM_CODE = ? AND SITE_CODE = ?"; sql = "SELECT SUM(HOLD_QTY) AS HOLD_QTY FROM STOCK WHERE ITEM_CODE = ? AND SITE_CODE = ?";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, itemCode); pstmt1.setString(1, itemCode);
...@@ -1379,7 +2287,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1379,7 +2287,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Changed by sumit sarkar on 22/06/12 setting alloc_flag START. //Changed by sumit sarkar on 22/06/12 setting alloc_flag START.
//ALLOC_FLAG //ALLOC_FLAG
//Changed by sumit on 22/08/12 getting alloc flag start. //Changed by sumit on 22/08/12 getting alloc flag start.
/* //allocFlag = rs.getString("ALLOC_FLAG"); //allocFlag = rs.getString("ALLOC_FLAG");
sql = " SELECT FN_MANUAL_STOCK_FOR_EACHITEM(?,?) AS ALLOC_FLAG FROM DUAL"; sql = " SELECT FN_MANUAL_STOCK_FOR_EACHITEM(?,?) AS ALLOC_FLAG FROM DUAL";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,saleOrderTran); pstmt1.setString(1,saleOrderTran);
...@@ -1408,10 +2316,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1408,10 +2316,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
rs2 = null; rs2 = null;
} }
//Changed by sumit on 22/08/12 getting alloc flag end. //Changed by sumit on 22/08/12 getting alloc flag end.
*/
//Changed by Pragyan 17/12/12 to get the total amount for allocation //Changed by Pragyan 17/12/12 to get the total amount for allocation
/*sql = "SELECT QTY_ALLOC FROM SORDALLOC WHERE SALE_ORDER = ? AND LINE_NO = ? " + sql = "SELECT QTY_ALLOC FROM SORDALLOC WHERE SALE_ORDER = ? AND LINE_NO = ? " +
"AND (CASE WHEN WAVE_FLAG IS NULL THEN 'N' ELSE WAVE_FLAG END) = 'N'";*/ "AND (CASE WHEN WAVE_FLAG IS NULL THEN 'N' ELSE WAVE_FLAG END) = 'N'";
sql = "SELECT SUM(QTY_ALLOC) AS MAN_QTY FROM SORDALLOC WHERE SALE_ORDER = ? AND LINE_NO = ? " + sql = "SELECT SUM(QTY_ALLOC) AS MAN_QTY FROM SORDALLOC WHERE SALE_ORDER = ? AND LINE_NO = ? " +
"AND (CASE WHEN WAVE_FLAG IS NULL THEN 'N' ELSE WAVE_FLAG END) = 'N'"; "AND (CASE WHEN WAVE_FLAG IS NULL THEN 'N' ELSE WAVE_FLAG END) = 'N'";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
...@@ -1651,7 +2559,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1651,7 +2559,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
} }
} }
return resultString; return resultString;
} }*/
//Changed BY Pragyan 20JUL13 TO Optimize the code for Open maximum open cursors.end
//Process Method //Process Method
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException
...@@ -1753,6 +2663,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1753,6 +2663,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
double qtyAvailAlloc = 0; double qtyAvailAlloc = 0;
String stockQuantity = ""; String stockQuantity = "";
String errString = ""; String errString = "";
String sSQLUpdatSord = "";
//Chnaged by sumit on 27/08/12 getting waveFlag from sord_alloc. //Chnaged by sumit on 27/08/12 getting waveFlag from sord_alloc.
String waveFlag = ""; String waveFlag = "";
//Change by Rohan on 22/08/12 to get arraylist for manual stock allocation.start //Change by Rohan on 22/08/12 to get arraylist for manual stock allocation.start
...@@ -1783,6 +2694,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1783,6 +2694,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
Node childNode = null; Node childNode = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
PreparedStatement pstmtUpdSord = null;
//Statement st = null; //Statement st = null;
//HashMap itemHashMap = new HashMap(); //HashMap itemHashMap = new HashMap();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
...@@ -3107,6 +4019,33 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -3107,6 +4019,33 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
} }
System.out.println(" new wave id ["+waveId+"]"); System.out.println(" new wave id ["+waveId+"]");
errString = generateReport(waveId, conn); errString = generateReport(waveId, conn);
/*//Changed By Pragyan WM3DSUN015 To update status in Sorder as InProcess after .start
if("P".equalsIgnoreCase(waveMode))
{
int updateSorder = 0;
sSQLUpdatSord = "UPDATE SORDER SET SHIP_STATUS = ? WHERE SALE_ORDER IN (SELECT SALE_ORDER FROM " +
" WAVE_TASK_DET WHERE WAVE_ID = ? )";
pstmtSord = conn.prepareStatement(sSQLUpdatSord);
pstmtSord.setString(1, waveId);
updateSorder = pstmtSord.executeUpdate();
if(updateSorder > 0)
{
System.out.println(" SORDER UPDATE COUNT ["+updateSorder+"]");
}
if( pstmtSord!= null)
{
pstmtSord.close();
pstmtSord = null;
}
}
//Changed By Pragyan WM3DSUN015 To update status in Sorder as InProcess after .end
*/
} }
//Changed by sumit on 25/08/12 .end //Changed by sumit on 25/08/12 .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