Commit 2aee0a5b authored by ppatro's avatar ppatro

To merge src for WMS updated wave gen changes and phy item scan


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92020 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b1b10ad4
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -1466,10 +1466,13 @@ public class PhyScanVerifyIC extends ValidatorEJB implements PhyScanVerifyICLoca ...@@ -1466,10 +1466,13 @@ public class PhyScanVerifyIC extends ValidatorEJB implements PhyScanVerifyICLoca
valueXmlString.append("<tran_id>").append(tranId).append("</tran_id>\r\n"); valueXmlString.append("<tran_id>").append(tranId).append("</tran_id>\r\n");
valueXmlString.append("<line_no>").append(lineNo).append("</line_no>\r\n"); valueXmlString.append("<line_no>").append(lineNo).append("</line_no>\r\n");
valueXmlString.append("<item_code>").append(checkNullAndTrim(itemCode)).append("</item_code>\r\n"); valueXmlString.append("<item_code>").append(checkNullAndTrim(itemCode)).append("</item_code>\r\n");
valueXmlString.append("<descr>").append(itemDescr).append("</descr>\r\n"); //Changed by sankara on 19/10/2012 to append descr in CDATA format
//valueXmlString.append("<descr>").append(itemDescr).append("</descr>\r\n");
valueXmlString.append( "<descr><![CDATA[" ).append( checkNull(itemDescr)).append( "]]></descr>\r\n" );
valueXmlString.append("<site_code>").append(siteCode).append("</site_code>\r\n"); valueXmlString.append("<site_code>").append(siteCode).append("</site_code>\r\n");
valueXmlString.append("<loc_code><![CDATA[").append(checkNullAndTrim(locCode)).append("]]></loc_code>\r\n"); valueXmlString.append("<loc_code><![CDATA[").append(checkNullAndTrim(locCode)).append("]]></loc_code>\r\n");
valueXmlString.append("<location_descr>").append(locDescr).append("</location_descr>\r\n"); //valueXmlString.append("<location_descr>").append(locDescr).append("</location_descr>\r\n");
valueXmlString.append("<location_descr><![CDATA[").append(locDescr)).append("]]></location_descr>\r\n")
valueXmlString.append("<lot_no>").append(checkNullAndTrim(lotNo)).append("</lot_no>\r\n"); valueXmlString.append("<lot_no>").append(checkNullAndTrim(lotNo)).append("</lot_no>\r\n");
valueXmlString.append("<lot_sl><![CDATA[").append(checkNullAndTrim(lotSl)).append("]]></lot_sl>\r\n"); valueXmlString.append("<lot_sl><![CDATA[").append(checkNullAndTrim(lotSl)).append("]]></lot_sl>\r\n");
valueXmlString.append("<quantity>").append(quantity).append("</quantity>\r\n"); valueXmlString.append("<quantity>").append(quantity).append("</quantity>\r\n");
......
...@@ -992,6 +992,36 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -992,6 +992,36 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
retTabSepStrBuff.append("0.0").append("\t"); retTabSepStrBuff.append("0.0").append("\t");
} }
//Changed by sumit on 22/08/12 getting alloc flag start.
sql = " SELECT FN_MANUAL_STOCK_FOR_EACHITEM(?,?) AS ALLOC_FLAG FROM DUAL";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,saleOrderTran);
pstmt1.setString(2,rs.getString(3));
rs2 = pstmt1.executeQuery();
if(rs2.next())
{
allocFlag = rs2.getString("ALLOC_FLAG");
}
if ("M".equalsIgnoreCase(allocFlag))
{
allocFlag = allocFlag;
}
else
{
allocFlag = "";
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if( rs2 != null)
{
rs2.close();
rs2 = null;
}
//Changed by sumit on 22/08/12 getting alloc flag end.
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// alloc_qty to be set based on stock availability // alloc_qty to be set based on stock availability
// it should not be more than pending quantity // it should not be more than pending quantity
...@@ -1008,7 +1038,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1008,7 +1038,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
allocQty = balStockQty; allocQty = balStockQty;
balStockQty = 0; balStockQty = 0;
} }
if(DefaultQtyFlag.equals("Y")) //Changed by sumit on 22/08/12 getting alloc flag
//if(DefaultQtyFlag.equals("Y"))
if(DefaultQtyFlag.equals("Y") && !"M".equalsIgnoreCase(allocFlag))
{ {
retTabSepStrBuff.append(allocQty).append("\t"); retTabSepStrBuff.append(allocQty).append("\t");
} }
...@@ -1032,7 +1064,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1032,7 +1064,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Changed by sankara on 25-06-2012 to set 0.0 instead of 0 //Changed by sankara on 25-06-2012 to set 0.0 instead of 0
//retTabSepStrBuff.append("0").append("\t"); //retTabSepStrBuff.append("0").append("\t");
retTabSepStrBuff.append("0.0").append("\t"); retTabSepStrBuff.append("0.0").append("\t");
} }
// this line has to be commented later // this line has to be commented later
// as this will be a input from the user // as this will be a input from the user
...@@ -1059,7 +1092,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1059,7 +1092,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);
...@@ -1088,8 +1121,33 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1088,8 +1121,33 @@ 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.
*/
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'";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, saleOrderTran);
pstmt1.setString(2, rs.getString(3));
rs2 = pstmt1.executeQuery();
if( rs2.next())
{
retTabSepStrBuff.append(rs2.getString("QTY_ALLOC")).append("\t");
}
else
{
retTabSepStrBuff.append("0.0").append("\t");
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if( rs2 != null)
{
rs2.close();
rs2 = null;
}
if (allocFlag == null) if (allocFlag == null)
{ {
allocFlag = ""; allocFlag = "";
...@@ -1583,23 +1641,32 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1583,23 +1641,32 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
} }
//changed by sankara on 03-08-2012[end] //changed by sankara on 03-08-2012[end]
String lineNoSord = lineNo;
lineNoSord = " " + lineNoSord;
lineNoSord = lineNoSord.substring(lineNoSord.length()-3);
// Changed by sumit on 14/08/12 for manual stock allocation (as per rohan) start. // Changed by sumit on 14/08/12 for manual stock allocation (as per rohan) start.
sql = "SELECT D.WAVE_FLAG FROM SORD_ALLOC S,SORD_ALLOC_DET D"+ /*sql = " SELECT D.WAVE_FLAG FROM SORD_ALLOC S,SORD_ALLOC_DET D"+
" WHERE S.TRAN_ID = D.TRAN_ID"+ " WHERE S.TRAN_ID = D.TRAN_ID"+
" AND S.SALE_ORDER = ?"+ " AND S.SALE_ORDER = ?"+
" AND D.LINE_NO__SORD = ?"+ " AND D.LINE_NO__SORD = ?"+
" AND D.ITEM_CODE = ?"+ " AND D.ITEM_CODE = ?"+
" AND D.EXP_LEV = ?"+ " AND D.EXP_LEV = ?"+
" AND CONFIRMED = ?"; " AND CONFIRMED = ?"; */
sql = " SELECT D.WAVE_FLAG FROM SORDALLOC D"+
" WHERE D.SALE_ORDER = ?"+
" AND D.LINE_NO = ?"+
" AND D.ITEM_CODE = ?"+
" AND D.EXP_LEV = ?";
//" AND CONFIRMED = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,saleOrder); pstmt.setString(1,saleOrder);
pstmt.setString(2, lineNo); pstmt.setString(2,lineNoSord);
pstmt.setString(3,itemCode); pstmt.setString(3,itemCode);
pstmt.setString(4,expLev); pstmt.setString(4,expLev);
pstmt.setString(5,"Y"); //pstmt.setString(5,"Y");
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
...@@ -1709,7 +1776,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1709,7 +1776,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
tempListForRepl = new ArrayList(); tempListForRepl = new ArrayList();
qtyActual=0.0; qtyActual=0.0;
if(qtyAllocate < itemPackSize)
//Changed By Pragyan as It is not reuired actives are treated separately.start
/*if(qtyAllocate < itemPackSize)
{ {
tempMapReplenishment.put("QTY_AVAIL",itemPackSize); tempMapReplenishment.put("QTY_AVAIL",itemPackSize);
...@@ -1722,8 +1791,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1722,8 +1791,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
else else
{ {
tempMapReplenishment.put("QTY_AVAIL",stkQuantity); tempMapReplenishment.put("QTY_AVAIL",stkQuantity);
} }*/
//Changed By Pragyan as It is not reuired actives are treated separately.
tempMapReplenishment.put("QTY_ACTUAL", qtyActual); tempMapReplenishment.put("QTY_ACTUAL", qtyActual);
tempMapReplenishment.put("LAST_REPL_ID", lastReplenishmentID); tempMapReplenishment.put("LAST_REPL_ID", lastReplenishmentID);
tempMapReplenishment.put("REPL_LINE_NO", lineNoRepl); tempMapReplenishment.put("REPL_LINE_NO", lineNoRepl);
...@@ -1810,10 +1879,11 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -1810,10 +1879,11 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
if(manualStock) if(manualStock)
{ {
int update = 0; int update = 0;
String lineNoSord = lineNo; /*String lineNoSord = lineNo;
lineNoSord = " " + lineNoSord; lineNoSord = " " + lineNoSord;
lineNoSord = lineNoSord.substring(lineNoSord.length()-3); lineNoSord = lineNoSord.substring(lineNoSord.length()-3);*/
sql= "UPDATE SORD_ALLOC_DET SET WAVE_FLAG = 'Y' WHERE SALE_ORDER = ? AND LINE_NO__SORD = ?"; //sql= "UPDATE SORD_ALLOC_DET SET WAVE_FLAG = 'Y' WHERE SALE_ORDER = ? AND LINE_NO__SORD = ?";
sql= "UPDATE SORDALLOC SET WAVE_FLAG = 'Y' WHERE SALE_ORDER = ? AND LINE_NO = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, saleOrder); pstmt.setString(1, saleOrder);
pstmt.setString(2, lineNoSord); pstmt.setString(2, lineNoSord);
...@@ -2211,13 +2281,12 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -2211,13 +2281,12 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
System.out.println("STOCK TO DOCK TRUE CASE VOLUME (NoOfCases * caseVolume1)["+(NoOfCases * caseVolume1)+"]"); System.out.println("STOCK TO DOCK TRUE CASE VOLUME (NoOfCases * caseVolume1)["+(NoOfCases * caseVolume1)+"]");
if(NoOfCases > 0 && (NoOfCases * caseVolume1) <= palletVolume && ((palletVolume - (NoOfCases * caseVolume1)) < caseVolume1)) if(NoOfCases > 0 && (NoOfCases * caseVolume1) <= palletVolume && ((palletVolume - (NoOfCases * caseVolume1)) < caseVolume1))
{ {
System.out.println("STOCK TO DOCK TRUE"); System.out.println("STOCK TO DOCK TRUE");
isStockToDock = true; isStockToDock = true;
} }
} }
/*if((pendingQty % packSize1) > 0) /*if((pendingQty % packSize1) > 0)
{ {
orderByStkStr = "ORDER BY STOCK.EXP_DATE,INVSTAT.ALLOC_PREF, STOCK.LOC_CODE "; orderByStkStr = "ORDER BY STOCK.EXP_DATE,INVSTAT.ALLOC_PREF, STOCK.LOC_CODE ";
...@@ -2608,7 +2677,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -2608,7 +2677,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
} }
if (count > 0 ) if (count > 0 )
{ {
updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC + " + new Double(lotQtyToBeAllocated).toString() //updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC + " + new Double(lotQtyToBeAllocated).toString()
updateSql = "UPDATE SORDALLOC SET WAVE_FLAG = 'Y' , QTY_ALLOC = QTY_ALLOC + " + new Double(lotQtyToBeAllocated).toString()
+ " WHERE SALE_ORDER = '" + saleOrder + " ' " + " WHERE SALE_ORDER = '" + saleOrder + " ' "
+ " AND LINE_NO = '" + lineNo + "' " + " AND LINE_NO = '" + lineNo + "' "
+ " AND EXP_LEV = '" + expLev + "' " + " AND EXP_LEV = '" + expLev + "' "
...@@ -2627,9 +2697,11 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -2627,9 +2697,11 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
+"ITEM_CODE,QUANTITY ,LOT_NO, LOT_SL, LOC_CODE, UNIT, QTY_ALLOC," +"ITEM_CODE,QUANTITY ,LOT_NO, LOT_SL, LOC_CODE, UNIT, QTY_ALLOC,"
+"ITEM_REF, DATE_ALLOC, STATUS,ITEM_GRADE, EXP_DATE, ALLOC_MODE, " +"ITEM_REF, DATE_ALLOC, STATUS,ITEM_GRADE, EXP_DATE, ALLOC_MODE, "
+" CONV__QTY_STDUOM, UNIT__STD, QUANTITY__STDUOM, " +" CONV__QTY_STDUOM, UNIT__STD, QUANTITY__STDUOM, "
+"MFG_DATE, SITE_CODE__MFG ) " //+"MFG_DATE, SITE_CODE__MFG ) "
+"MFG_DATE, SITE_CODE__MFG,WAVE_FLAG ) "
+"VALUES ( ?, ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ," +"VALUES ( ?, ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ,"
+" ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) " ; //+" ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) " ;
+" ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ,? ) " ;
pstmtStockInsertSordAlloc = conn.prepareStatement(insertSql); pstmtStockInsertSordAlloc = conn.prepareStatement(insertSql);
...@@ -2704,6 +2776,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -2704,6 +2776,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//SITE_CODE__MFG //SITE_CODE__MFG
pstmtStockInsertSordAlloc.setString(23,siteCodeMfg); pstmtStockInsertSordAlloc.setString(23,siteCodeMfg);
System.out.println("siteCodeMfg------->"+siteCodeMfg); System.out.println("siteCodeMfg------->"+siteCodeMfg);
pstmtStockInsertSordAlloc.setString(24,"Y");
System.out.println("WAVE FLAG-------> Y");
//QTY_DESP //QTY_DESP
intCnt = pstmtStockInsertSordAlloc.executeUpdate(); intCnt = pstmtStockInsertSordAlloc.executeUpdate();
...@@ -2749,9 +2823,19 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -2749,9 +2823,19 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
double itemWeight = (Double)itmVolumeMap.get("ITEM_WEIGHT"); double itemWeight = (Double)itmVolumeMap.get("ITEM_WEIGHT");
double caseCount = lotQtyToBeAllocated /packSize; double caseCount = lotQtyToBeAllocated /packSize;
// //
System.out.println("CASE VOLUME----->["+caseVolume+"]");
System.out.println("CASE caseCount----->["+caseCount+"]");
System.out.println("(caseCount * caseVolume)----->["+(caseCount * caseVolume)+"]");
System.out.println("((palletVolume - (caseCount * caseVolume))----->["+((palletVolume - (caseCount * caseVolume)))+"]");
System.out.println("to check with floor["+Math.floor((palletVolume / caseVolume))+"]");
System.out.println("to check with Round["+Math.round((palletVolume / caseVolume))+"]");
System.out.println("to check with ceil["+Math.ceil((palletVolume / caseVolume))+"]");
System.out.println("to check with ["+(palletVolume / caseVolume)+"]");
if(caseCount > 0 && (caseCount * caseVolume) <= palletVolume && ((palletVolume - (caseCount * caseVolume)) < caseVolume)) if(caseCount > 0 && (caseCount * caseVolume) <= palletVolume && ((palletVolume - (caseCount * caseVolume)) < caseVolume))
{ {
System.out.println("STOCK TO DOCK TRUE"); System.out.println("STOCK TO DOCK TRUE===============================");
isStockToDock = true; isStockToDock = true;
} }
else if((lotQtyToBeAllocated * perItemVolume) <= palletVolume && ((palletVolume - (lotQtyToBeAllocated * perItemVolume)) < perItemVolume)) else if((lotQtyToBeAllocated * perItemVolume) <= palletVolume && ((palletVolume - (lotQtyToBeAllocated * perItemVolume)) < perItemVolume))
...@@ -10394,9 +10478,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -10394,9 +10478,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
String stockToDoc = ""; String stockToDoc = "";
//Changed by Rohan on 13-09-12 to generate only one Repalnishmement Header.start //Changed by Rohan on 13-09-12 to generate only one Repalnishmement Header.start
replCnt = 1; /*replCnt = 1;
isReplHdr = false; isReplHdr = false;
replOrdCpy = ""; replOrdCpy = "";*/
boolean isActivePickHdr = false; boolean isActivePickHdr = false;
String pickHdrCpy = ""; String pickHdrCpy = "";
//Changed by Rohan on 13-09-12 to generate only one Repalnishmement Header.end //Changed by Rohan on 13-09-12 to generate only one Repalnishmement Header.end
...@@ -10493,10 +10577,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -10493,10 +10577,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
HashMap itmVolumeMap = getItemVoumeMap(itemCode,lotNo,conn); HashMap itmVolumeMap = getItemVoumeMap(itemCode,lotNo,conn);
masterPackAllow = isMasterPackAllow; masterPackAllow = isMasterPackAllow;
double packSize = (Double)itmVolumeMap.get("PACK_SIZE");//How many item contains in the Case double packSize = (Double)itmVolumeMap.get("PACK_SIZE");//How many item contains in the Case
double perItemVolume = (Double)itmVolumeMap.get("ITEM_SIZE");//Each Item Volume double perItemVolume = Math.floor((Double)itmVolumeMap.get("ITEM_SIZE"));//Each Item Volume
double caseVolume = (Double)itmVolumeMap.get("LOT_SIZE");//Items Case Volume double caseVolume = Math.floor((Double)itmVolumeMap.get("LOT_SIZE"));//Items Case Volume
double caseWeight = (Double)itmVolumeMap.get("PACK_WEIGHT"); double caseWeight = Math.floor((Double)itmVolumeMap.get("PACK_WEIGHT"));
double itemWeight = (Double)itmVolumeMap.get("ITEM_WEIGHT"); double itemWeight = Math.floor((Double)itmVolumeMap.get("ITEM_WEIGHT"));
double activeCount = 0.0; double activeCount = 0.0;
double cashCount = 0.0; double cashCount = 0.0;
...@@ -11830,9 +11914,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -11830,9 +11914,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
invStat = (String)tempMap.get("inv_stat"); invStat = (String)tempMap.get("inv_stat");
invStat = invStat.trim(); invStat = invStat.trim();
packSizeCase = (Double)tempMap.get("pack_size"); packSizeCase = (Double)tempMap.get("pack_size");
mapItemVolume=getItemVoumeMap(itemCode, lotNo, conn); mapItemVolume = getItemVoumeMap(itemCode, lotNo, conn);
caseVolume=(Double)mapItemVolume.get("LOT_SIZE"); caseVolume = Math.floor((Double)mapItemVolume.get("LOT_SIZE"));
caseWeight=(Double)mapItemVolume.get("PACK_WEIGHT"); caseWeight =Math.floor( (Double)mapItemVolume.get("PACK_WEIGHT"));
caseVolumeTotal = Double.parseDouble(noArt)*caseVolume; caseVolumeTotal = Double.parseDouble(noArt)*caseVolume;
caseWeightTotal = Double.parseDouble(noArt)*caseWeight; caseWeightTotal = Double.parseDouble(noArt)*caseWeight;
System.out.println("CURRENTLY LOOKING FOR ITEM_CODE ["+itemCode+"]LOCATION CODE["+locCode+"]QUANTITY["+quantity+"]NO OF ART["+noArt+"]Counter["+aCtr+"]"); System.out.println("CURRENTLY LOOKING FOR ITEM_CODE ["+itemCode+"]LOCATION CODE["+locCode+"]QUANTITY["+quantity+"]NO OF ART["+noArt+"]Counter["+aCtr+"]");
...@@ -12222,8 +12306,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -12222,8 +12306,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
String actPkDeepLoc = "";//getAvilablePickLocation(pickType, conn, itemLocType,locZonePref,locCode,itemCode,siteCode,lotNo,lotSl); String actPkDeepLoc = "";//getAvilablePickLocation(pickType, conn, itemLocType,locZonePref,locCode,itemCode,siteCode,lotNo,lotSl);
mapItemVolume = getItemVoumeMap(itemCode, lotNo, conn); mapItemVolume = getItemVoumeMap(itemCode, lotNo, conn);
double itemVolume = (Double)mapItemVolume.get("ITEM_SIZE"); double itemVolume = Math.floor((Double)mapItemVolume.get("ITEM_SIZE"));
double itemWeight=(Double)mapItemVolume.get("ITEM_WEIGHT"); double itemWeight= Math.floor((Double)mapItemVolume.get("ITEM_WEIGHT"));
packSizeCase = (Double)mapItemVolume.get("PACK_SIZE"); packSizeCase = (Double)mapItemVolume.get("PACK_SIZE");
/*double itemVolumeTotal = quantity*itemVolume; /*double itemVolumeTotal = quantity*itemVolume;
double itemWeightTotal = quantity*itemWeight; */ double itemWeightTotal = quantity*itemWeight; */
...@@ -12471,7 +12555,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -12471,7 +12555,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pickRefId = updateWaveTaskDet(waveID,2,saleOrder,"A-PICK","A",ptcn,conn); pickRefId = updateWaveTaskDet(waveID,2,saleOrder,"A-PICK","A",ptcn,conn);
if(!isReplHdr) if(!isReplHdr)
{ {
replRefDeepId = updateWaveTaskDet(waveID,1,saleOrder,"R-ACT","E",ptcn,conn); replRefDeepId = updateWaveTaskDet(waveID,1,saleOrder,"R-CPA","E",ptcn,conn);
pstmtRplHdr.setString(1,replRefDeepId); pstmtRplHdr.setString(1,replRefDeepId);
pstmtRplHdr.setString(9,"Q"); pstmtRplHdr.setString(9,"Q");
pstmtRplHdr.executeUpdate(); pstmtRplHdr.executeUpdate();
...@@ -13909,7 +13993,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -13909,7 +13993,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
caseWeightTotal = ((double)(countCasesOfmasterPackWeightInt)/countCasesOfmasterPackWeight)*masterPackWeight; caseWeightTotal = ((double)(countCasesOfmasterPackWeightInt)/countCasesOfmasterPackWeight)*masterPackWeight;
//Changed by Ameya on 13/08/2012 to calculate caseWeightTotal for M-Pack End. //Changed by Ameya on 13/08/2012 to calculate caseWeightTotal for M-Pack End.
caseVolume = (Double)getItemVoumeMap(itemCode, lotNo, conn).get("LOT_SIZE"); caseVolume = Math.floor((Double)getItemVoumeMap(itemCode, lotNo, conn).get("LOT_SIZE"));
//Changed by Ameya on 13/08/2012 to calculate caseWeightTotal for M-Pack Start. //Changed by Ameya on 13/08/2012 to calculate caseWeightTotal for M-Pack Start.
//caseVolumeTotal = countCasesOfmasterPackWeight*caseVolume; //caseVolumeTotal = countCasesOfmasterPackWeight*caseVolume;
caseVolumeTotal = countCasesOfmasterPackWeightInt*caseVolume; caseVolumeTotal = countCasesOfmasterPackWeightInt*caseVolume;
...@@ -13921,7 +14005,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -13921,7 +14005,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
else else
{ {
caseWeightTotal = weightOfmasterPackCount; caseWeightTotal = weightOfmasterPackCount;
caseVolume = (Double)getItemVoumeMap(itemCode, lotNo, conn).get("LOT_SIZE"); caseVolume = Math.floor((Double)getItemVoumeMap(itemCode, lotNo, conn).get("LOT_SIZE"));
caseVolumeTotal = masterPackCount*caseVolume; caseVolumeTotal = masterPackCount*caseVolume;
totalNoArt = totalNoArt-(int)masterPackCount; totalNoArt = totalNoArt-(int)masterPackCount;
totalWeight = totalWeight-weightOfmasterPackCount; totalWeight = totalWeight-weightOfmasterPackCount;
...@@ -13931,7 +14015,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -13931,7 +14015,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
{ {
System.out.println("Only 1 MasterPack"); System.out.println("Only 1 MasterPack");
caseWeightTotal = totalWeight; caseWeightTotal = totalWeight;
caseVolume = (Double)getItemVoumeMap(itemCode, lotNo, conn).get("LOT_SIZE"); caseVolume = Math.floor((Double)getItemVoumeMap(itemCode, lotNo, conn).get("LOT_SIZE"));
caseVolumeTotal = totalNoArt*caseVolume; caseVolumeTotal = totalNoArt*caseVolume;
} }
System.out.println("caseWeightTotal="+caseWeightTotal); System.out.println("caseWeightTotal="+caseWeightTotal);
...@@ -14501,8 +14585,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -14501,8 +14585,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
} }
//packSize = (lotHeight * lotWidth * lotLen)/(itmLen * itmWidth * itmHeight); //packSize = (lotHeight * lotWidth * lotLen)/(itmLen * itmWidth * itmHeight);
itemSize = Math.floor(itmLen * itmWidth * itmHeight); /*itemSize = Math.floor(itmLen * itmWidth * itmHeight);
lotSize = Math.floor((lotHeight * lotWidth * lotLen)); lotSize = Math.floor((lotHeight * lotWidth * lotLen));*/
itemSize = itmLen * itmWidth * itmHeight;
lotSize = lotHeight * lotWidth * lotLen;
dataVolumeMap.put("PACK_SIZE", packSize); dataVolumeMap.put("PACK_SIZE", packSize);
dataVolumeMap.put("ITEM_SIZE", itemSize); dataVolumeMap.put("ITEM_SIZE", itemSize);
...@@ -16410,354 +16496,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16410,354 +16496,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
} }
System.out.println("errString last:::"+errString); System.out.println("errString last:::"+errString);
return errString; return errString;
} }
//Added by chandni --13-June-2012
private String updateMannualStockMap(Document detailDom,Connection conn) throws ITMException
{
String errString="";
PreparedStatement pstmt = null;
ResultSet rs = null;
int parentNodeListLength = 0;
NodeList parentNodeList = null;
Node parentNode = null;
int childNodeListLength = 0;
NodeList childNodeList = null;
Node childNode = null;
String childNodeName = "";
String saleOrder="",lineNo="",itemCode ="",sodreAlloc = "",resvInvStat = "",
sqlinvStat = "",invSt = "",expLev = "",lotSl = "",lotNo = "",locCd = "",locTypeParent = "" ;
HashMap<String,ArrayList> hMap = new HashMap<String,ArrayList>();
ArrayList hList =null;
ArrayList saleOrderList = new ArrayList();
String partQty = "",sorder="";
int ctr =0;
Integer maxLine=0;
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
boolean manualStock = false;
boolean isStockToDock = false;
double palletVolume = 0.0;
int qtyAllocate = 0,noOfArticals = 0;
HashMap tempMap = null;
ArrayList tempList = null;
HashMap chkSordMap = new HashMap();
try
{
resvInvStat = discommon.getDisparams("999999","RESERV_LOCATION",conn);
palletVolume = Double.parseDouble(discommon.getDisparams("999999","PER_PALLET__VOLUME",conn));
parentNodeList = detailDom.getElementsByTagName("Detail2");
parentNodeListLength = parentNodeList.getLength();
for (int selectedRow = 0; selectedRow < parentNodeListLength; selectedRow++)
{
int count = 0;
parentNode = parentNodeList.item(selectedRow);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for (int childRow = 0; childRow < childNodeListLength; childRow++)
{
childNode = childNodeList.item(childRow);
childNodeName = childNode.getNodeName();
if (childNodeName.equals("sale_order"))
{
saleOrder = childNode.getFirstChild().getNodeValue();
}
if (childNodeName.equals("line_no"))
{
lineNo = childNode.getFirstChild().getNodeValue();
}
/*if (childNodeName.equals("item_code"))
{
itemCode = childNode.getFirstChild().getNodeValue();
}*/
}//inner for loop
if(chkSordMap.containsKey(saleOrder))
{
continue;
}
else
{
chkSordMap.put(saleOrder, lineNo);
}
sql = "SELECT COUNT(*) AS CNT FROM SORD_ALLOC S,SORD_ALLOC_DET D,SORDER O"+
" WHERE S.TRAN_ID = D.TRAN_ID"+
" AND S.SALE_ORDER = ?"+
" AND S.SALE_ORDER = O.S.SALE_ORDER"+
" AND O.ALLOC_FLAG = ?"+
" AND CONFIRMED = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,saleOrder);
pstmt.setString(2,"M");
pstmt.setString(3,"Y");
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt("CNT");
}
System.out.println("Count Values"+count);
if(count == 1)
{
manualStock = true;
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
sodreAlloc = "SELECT S.QTY_ALLOC AS QTY_ALLOC,S.QUANTITY AS QUANTITY,S.LOT_SL AS LOT_SL,S.LOT_NO AS LOT_NO,"+
" S.LOC_COD AS LOC_CODE,I.LOC_TYPE__PARENT AS LOC_TYPE__PARENT FROM SORDALLOC S,ITEM_CODE I"+ //Changes done by chandni 08-06-12(instead of loc_type, loc_type__parent should be selected)
" WHERE S.SALE_ORDER = ? AND S.ITEM_CODE = I.ITEM_CODE ";
//" AND S.EXP_LEV = ?";
pstmt = conn.prepareStatement(sodreAlloc);
pstmt.setString(1,saleOrder);
//pstmt.setString(2, lineNo);
//pstmt.setString(3,itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
itemCode = rs.getString("ITEM_CODE");
qtyAllocate = rs.getInt("QTY_ALLOC");
noOfArticals = rs.getInt("QUANTITY");
lotSl = rs.getString("LOT_SL");
lotNo = rs.getString("LOT_NO");
locCd = rs.getString("LOC_CODE");
locTypeParent = checkNull(rs.getString("LOC_TYPE__PARENT")) ; //Changes done by chandni 08-06-12(instead of loc_type, loc_type__parent should be selected)
System.out.println("qtyAllocate"+qtyAllocate+"noOfArticals"+noOfArticals);
System.out.println("lotSl===<"+lotSl);
System.out.println("lot_no===<"+lotNo);
System.out.println("locCd===<"+locCd);
System.out.println("locType===<"+locTypeParent);
}
sqlinvStat = "SELECT INV_STAT FROM LOCATION WHERE LOC_CODE= ?";
pstmt = conn.prepareStatement(sqlinvStat);
pstmt.setString(1,locCd);
rs = pstmt.executeQuery();
if(rs.next())
{
invSt= rs.getString("INV_STAT");
System.out.println("INV STATSSS"+invSt);
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if (resvInvStat == null)
{
resvInvStat = "";
}
if(invSt != null && invSt.trim().equalsIgnoreCase(resvInvStat.trim()))
{
System.out.println("ENTER IN IF INVStat ! null");
HashMap itmVolumeMap = getItemVoumeMap(itemCode,lotNo,conn);
double packSize = (Double)itmVolumeMap.get("PACK_SIZE");//How many item contains in the Case
double perItemVolume = (Double)itmVolumeMap.get("ITEM_SIZE");//Each Item Volume
double caseVolume = (Double)itmVolumeMap.get("LOT_SIZE");//Items Case Volume
double caseWeight = (Double)itmVolumeMap.get("PACK_WEIGHT");
double itemWeight = (Double)itmVolumeMap.get("ITEM_WEIGHT");
double caseCount = qtyAllocate /packSize;
if(caseCount > 0 && (caseCount * caseVolume) <= palletVolume && ((palletVolume - (caseCount * caseVolume)) < caseVolume))
{
isStockToDock = true;
}
else if((qtyAllocate * perItemVolume) <= palletVolume && ((palletVolume - (qtyAllocate * perItemVolume)) < perItemVolume))
{
isStockToDock = true;
}
}
if(saleOrderWiseMap.containsKey(saleOrder+":"+locTypeParent))
{
//Changed By Pragyan Demo4
//tempList = (ArrayList) saleOrderWiseMap.get(saleOrder);
//tempList = (ArrayList) saleOrderWiseMap.get(saleOrder+":"+locType);
tempList = (ArrayList) saleOrderWiseMap.get(saleOrder+":"+locTypeParent); //Changes done by chandni 08-06-12(instead of loc_type, loc_type__parent should be selected)
}
else
{
tempList = new ArrayList();
}
// populate the map with the stock keys
tempMap = new HashMap();
tempMap.put("site_code", siteCode);
tempMap.put("item_code", itemCode);
tempMap.put("loc_code", locCd);
tempMap.put("lot_no", lotNo);
tempMap.put("lot_sl", lotSl);
tempMap.put("no_art", String.valueOf(noOfArticals));
tempMap.put("alloc_qty", qtyAllocate);
tempMap.put("inv_stat", invSt);
if(isStockToDock)
{
tempMap.put("stock2_dock", "Y");
}
else
{
tempMap.put("stock2_dock", "N");
}
tempMap.put("exp_lev", expLev);
tempList.add(tempMap);
saleOrderWiseMap.put(saleOrder+":"+locTypeParent,tempList);
}
} // end of for childNodeListLength
System.out.println("*****saleOrder--->"+saleOrder);
System.out.println("*****lineNo--->"+lineNo);
System.out.println("*****itemCode--->"+itemCode);
if(hMap.containsKey(saleOrder+":"+locTypeParent))
{
hList =(ArrayList)hMap.get(saleOrder+":"+locTypeParent);
}
else
{
hList = new ArrayList();
}
hList.add(itemCode);
hMap.put(saleOrder+":"+locTypeParent, hList);
}//try end
catch(Exception e)
{
System.out.println("Exception in == >"+e);
throw new ITMException(e);
}
finally
{
try
{
if( rs != null )
{
rs.close();
rs = null;
}
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
}
catch (Exception e1)
{
errString = e1.getMessage();
e1.printStackTrace();
throw new ITMException(e1);
}
}
System.out.println("errString last:::"+errString);
return errString;
}
/* Added By Ashish Sonawane on 7-Jul-12 To get gross weigh of the item [START]
private double getGrossWeight(String itemCode,String lotNo,Connection conn) throws ITMException
{
String sqlGrossWeight = "";
ResultSet rsGrossWeight = null;
PreparedStatement pstmtGrossWeight = null;
double grossWeight =0.0;
try
{
sqlGrossWeight = "SELECT GROSS_WEIGHT FROM ITEM_LOT_PACKSIZE"
+ " WHERE ITEM_CODE = ? AND LOT_NO =? ";
pstmtGrossWeight = conn.prepareStatement(sqlGrossWeight);
pstmtGrossWeight.setString(1, itemCode);
pstmtGrossWeight.setString(2, lotNo);
rsGrossWeight = pstmtGrossWeight.executeQuery();
while (rsGrossWeight.next())
{
grossWeight = rsGrossWeight.getDouble("GROSS_WEIGHT");
}
if( rsGrossWeight != null )
{
rsGrossWeight.close();
rsGrossWeight = null;
}
if( pstmtGrossWeight != null )
{
pstmtGrossWeight.close();
pstmtGrossWeight = null;
}
}
catch(Exception e)
{
System.out.println("Exception in getGrossWeight == >"+e);
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if( rsGrossWeight != null )
{
rsGrossWeight.close();
rsGrossWeight = null;
}
if( pstmtGrossWeight != null )
{
pstmtGrossWeight.close();
pstmtGrossWeight = null;
}
}
catch (Exception e1)
{
}
}
return grossWeight;
}
Added By Ashish Sonawane on 7-Jul-12 To get gross weigh of the item [END]*/
private String getError(String saleOrder,String Code,Connection conn) throws ITMException, Exception private String getError(String saleOrder,String Code,Connection conn) throws ITMException, Exception
{ {
String mainStr =""; String mainStr ="";
...@@ -16909,7 +16648,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16909,7 +16648,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
String sSQL = "SELECT PICK_ORDER,LINE_NO__PICK FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ? "; String sSQL = "SELECT REPL_ORDER , LINE_NO ,LOC_CODE__TO FROM REPL_ORD_DET WHERE PICK_ORDER = ? AND LINE_NO__PICK = ? ";
try { try {
...@@ -17017,9 +16756,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -17017,9 +16756,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
{ {
pickLineNo =(Integer)itemSitemap.get("LINE_NO_PICK"); pickLineNo =(Integer)itemSitemap.get("LINE_NO_PICK");
} }
pickOrd = pickOrd !=null && pickOrd.length() > 0?pickOrd:"X"; pickOrd = pickOrd !=null && pickOrd.length() > 0?pickOrd:"0";
if(pickOrd.equalsIgnoreCase("X") && replID != null && replID.length() > 0) if(pickOrd.equalsIgnoreCase("0") && replID != null && replID.length() > 0)
{ {
pstmt = conn.prepareStatement(sSQL); pstmt = conn.prepareStatement(sSQL);
pstmt.setString(1,replID); pstmt.setString(1,replID);
...@@ -17028,9 +16767,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -17028,9 +16767,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
while (rs.next()) while (rs.next())
{ {
pickOrd = rs.getString("PICK_ORDER"); pickOrd = rs.getString(1);
pickOrd = pickOrd !=null && pickOrd.length() > 0?pickOrd:"X"; pickOrd = pickOrd !=null && pickOrd.length() > 0?pickOrd:"0";
pickLineNo = rs.getInt("LINE_NO__PICK"); pickLineNo = rs.getInt(2);
replLocTo = rs.getString(3);
} }
if(rs != null) if(rs != 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