Commit bcaad609 authored by rtiwari's avatar rtiwari

updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96118 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2b6d4250
...@@ -77,6 +77,10 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -77,6 +77,10 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
String chgTerm = null; String chgTerm = null;
boolean stkAllocateFlag = false; boolean stkAllocateFlag = false;
String shiperSizeError = "";
boolean errFlag = false;
ArrayList list2 = new ArrayList();
int elements2 = 0;
/*public void ejbCreate() throws RemoteException, CreateException /*public void ejbCreate() throws RemoteException, CreateException
{ {
...@@ -968,10 +972,12 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -968,10 +972,12 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Statement st = null; Statement st = null;
int elements = 0,elements1 = 0,cnt=0,elements2 = 0,elements3 = 0,elements4 = 0; int elements = 0,elements1 = 0,cnt=0,elements3 = 0,elements4 = 0;
elements2 = 0;
ArrayList list = new ArrayList(); ArrayList list = new ArrayList();
ArrayList list1 = new ArrayList(); ArrayList list1 = new ArrayList();
ArrayList list2 = new ArrayList(); // ArrayList list2 = new ArrayList();
list2 = new ArrayList();
ArrayList list3 = new ArrayList(); ArrayList list3 = new ArrayList();
ArrayList list4 = new ArrayList(); ArrayList list4 = new ArrayList();
boolean flag = false,isFlag = true,allocqtyflag = false,pendingOrderFlag=false; boolean flag = false,isFlag = true,allocqtyflag = false,pendingOrderFlag=false;
...@@ -983,6 +989,10 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -983,6 +989,10 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
// ArrayList itemList = new ArrayList();; // ArrayList itemList = new ArrayList();;
String itemList = ""; String itemList = "";
ArrayList<String> sorderList = new ArrayList<String>(); ArrayList<String> sorderList = new ArrayList<String>();
stkAllocateFlag = false;
shiperSizeError = "";
errFlag = false;
System.out.println(" reset class variables --");
try try
{ {
...@@ -1219,7 +1229,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -1219,7 +1229,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
{ {
// ADDED BY RITESH ON 09/08/14 START // ADDED BY RITESH ON 09/08/14 START
System.out.println("if calling...allocQty > 0....."); System.out.println("if calling...allocQty > 0.....");
itemList = saleOrder+","+lineNo+","+itemCode+","+allocQty+","+expLev+","+holdFlag+","+holdFlag+","+activeAllow; itemList = saleOrder+","+lineNo+","+itemCode+","+allocQty+","+expLev+","+holdFlag+","+activeAllow;
System.out.println("@@@@@@@@ sorderList["+sorderList+"]saleOrder+activeAllow["+saleOrder+activeAllow+"]"); System.out.println("@@@@@@@@ sorderList["+sorderList+"]saleOrder+activeAllow["+saleOrder+activeAllow+"]");
if(!sorderList.contains(saleOrder+activeAllow)) // added activeAllow in if condition by cpatil on 20/08/14 if(!sorderList.contains(saleOrder+activeAllow)) // added activeAllow in if condition by cpatil on 20/08/14
{ {
...@@ -1300,17 +1310,19 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -1300,17 +1310,19 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
// errString = sorderAllocate(saleOrder, lineNo, itemCode, allocQty, expLev ,holdFlag,activeAllow,xtraParams); // errString = sorderAllocate(saleOrder, lineNo, itemCode, allocQty, expLev ,holdFlag,activeAllow,xtraParams);
// ADDED BY RITESH ON 09/08/14 END // ADDED BY RITESH ON 09/08/14 END
System.out.println("@@@@@@ sorderAllocate return string["+errString+"]"); System.out.println("@@@@@@ sorderAllocate return string["+errString+"]");
if (errString != null && errString.trim().length() > 0)
if ((errString != null && errString.trim().length() > 0 ) || errFlag)
{ {
if( errString.indexOf("VSTQTYER") != -1) if( errString.indexOf("VSTQTYER") != -1 || errFlag)
{ {
System.out.println("@@@@@@@@@[VSTQTYER]"); System.out.println("@@@@@@@@@[VSTQTYER]");
isFlag = false; isFlag = false;
list2.add(saleOrder); // list2.add(saleOrder);
list2.add(lineNo); // list2.add(lineNo);
list2.add(itemCode); // list2.add(itemCode);
list2.add(allocQty); // list2.add(allocQty);
elements2 ++; System.out.println(" error item list2 ::"+list2);
// elements2 ++;
errString = ""; errString = "";
} }
else else
...@@ -1340,6 +1352,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -1340,6 +1352,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
if(stkAllocateFlag) if(stkAllocateFlag)
{ {
errString = "PROCSUCC"; errString = "PROCSUCC";
} }
else else
{ {
...@@ -1393,23 +1406,43 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -1393,23 +1406,43 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
if(rs.next()) if(rs.next())
{ {
singLot = rs.getString(1); singLot = rs.getString(1);
}pstmt.close();pstmt = null;rs.close();rs = null; System.out.println("singLot ::["+singLot+"]");
if("Y".equalsIgnoreCase(singLot)) }
pstmt.close();pstmt = null;
System.out.println(" @@@@@@@1 ");
rs.close();rs = null;
System.out.println(" @@@@@@@2 "+mainStr);
if("SHIPPERSIZEERR".equalsIgnoreCase(shiperSizeError))
{
mainStr = mainStr + "\n Shipper Size not define.\n";System.out.println(" @@@@@@@45 ");
}
else if("Y".equalsIgnoreCase(singLot))
{
mainStr = mainStr + "\n Stock not available in single lot.\n";System.out.println(" @@@@@@@455 ");
}
else
{ {
mainStr = mainStr + "\n Stock not available in single lot.\n"; mainStr = mainStr + "\n Insufficient stock available.\n";System.out.println(" @@@@@@@4555 ");
}else{
mainStr = mainStr + "\n Insufficient stock available.\n";
} }
System.out.println(" @@@@@@@3 "+mainStr);
} }
System.out.println(" elsement2 - "+elements2 +"&&&&"+ list2);
for(int i = 0; i < elements2 * 4 ; i++ ) for(int i = 0; i < elements2 * 4 ; i++ )
{ {
System.out.println(" iterator i - "+i);
if( i > 0) if( i > 0)
{ {
i -= 1; i -= 1;
} }
mainStr = mainStr + mainStr = mainStr +
"sale order :"+list2.get(i++)+ ",line no :"+ list2.get(i++) + ",item code :"+list2.get(i++)+",quantity :"+list2.get(i++)+"\n" ; "sale order :"+list2.get(i++)+ ",line no :"+ list2.get(i++) + ",item code :"+list2.get(i++)+",quantity :"+list2.get(i++)+"\n" ;
} }
System.out.println(" @@@@@@@4 "+mainStr);
//added by kunal on 27/dec/13 //added by kunal on 27/dec/13
if( elements3 > 0 ) if( elements3 > 0 )
{ {
...@@ -1440,8 +1473,8 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -1440,8 +1473,8 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
//added by kunal on 27/dec/13 end //added by kunal on 27/dec/13 end
System.out.println(" @@@@@@@mainStr "+mainStr);
mainStr = mainStr + endPart; mainStr = mainStr + endPart; System.out.println(" @@@@@@@mainStr+endPart "+mainStr);
errString = mainStr; errString = mainStr;
begPart =null; begPart =null;
endPart =null; endPart =null;
...@@ -1483,8 +1516,11 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -1483,8 +1516,11 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
}//try end }//try end
catch(Exception e) catch(Exception e)
{ {
e.printStackTrace();
System.out.println("Exception :StockAllocationPrcEJB :process(String xmlString2, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":"); System.out.println("Exception :StockAllocationPrcEJB :process(String xmlString2, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
errString = e.getMessage(); errString = e.getMessage();
System.out.println();
return errString ; return errString ;
} }
finally finally
...@@ -1551,7 +1587,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -1551,7 +1587,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
// private String sorderAllocate(String saleOrder, String lineNo, String itemCode, double allocQty, String expLev ,String holdFlag,String activeAllow,String xtraParams) throws ITMException // private String sorderAllocate(String saleOrder, String lineNo, String itemCode, double allocQty, String expLev ,String holdFlag,String activeAllow,String xtraParams) throws ITMException
private String sorderAllocate(HashMap soLnValues,String xtraParams) throws ITMException private String sorderAllocate(HashMap soLnValues,String xtraParams) throws ITMException
{ {
System.out.println("sorderAllocate calling .............."); System.out.println("sorderAllocate calling .260814...RITESH..........");
String saleOrder = "", lineNo = "", itemCode = ""; String saleOrder = "", lineNo = "", itemCode = "";
double allocQty = 0d; double allocQty = 0d;
String expLev = "" ,holdFlag = "", activeAllow= ""; String expLev = "" ,holdFlag = "", activeAllow= "";
...@@ -1608,7 +1644,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -1608,7 +1644,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
ResultSet rs = null ; ResultSet rs = null ;
ResultSet rsSItem = null; ResultSet rsSItem = null;
StringBuffer xmlBuff = null; StringBuffer xmlBuff = null;
String xmlString = "",retString = null; String xmlString = "",retString = "";
DistCommon dComm = new DistCommon(); DistCommon dComm = new DistCommon();
Timestamp sysDate = null; Timestamp sysDate = null;
Calendar currentDate = Calendar.getInstance(); Calendar currentDate = Calendar.getInstance();
...@@ -1631,6 +1667,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -1631,6 +1667,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
boolean isHdr = true; boolean isHdr = true;
String allocqtyStr = ""; String allocqtyStr = "";
boolean allocQtyFlag = false; boolean allocQtyFlag = false;
boolean isdetFlag = false;
// ADDED BY RITESH ON 15/07/14 END // ADDED BY RITESH ON 15/07/14 END
try try
{ {
...@@ -1658,7 +1695,6 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -1658,7 +1695,6 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
while(it.hasNext()) while(it.hasNext())
{ {
count ++; count ++;
TreeMap stockLot=new TreeMap<String,Double>(); TreeMap stockLot=new TreeMap<String,Double>();
TreeMap<String,ArrayList<String>>stockLotDetail=new TreeMap<String, ArrayList<String>>(); TreeMap<String,ArrayList<String>>stockLotDetail=new TreeMap<String, ArrayList<String>>();
ArrayList<String> lotList= new ArrayList<String>(); ArrayList<String> lotList= new ArrayList<String>();
...@@ -1667,8 +1703,8 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -1667,8 +1703,8 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
boolean checkLocation = false; boolean checkLocation = false;
boolean isActives = false; boolean isActives = false;
boolean getLotFlag = false ; boolean getLotFlag = false ;
if(count>1) // if(count>1)
isHdr = false; // isHdr = false;
String key = (String)it.next();System.out.println("key value:[]:"+key);System.out.println("soLnValues.get(key)::"+soLnValues.get(key)); String key = (String)it.next();System.out.println("key value:[]:"+key);System.out.println("soLnValues.get(key)::"+soLnValues.get(key));
String solnValueList[] = ((String)soLnValues.get(key)).split(",");System.out.println("solnValueList::"+solnValueList); String solnValueList[] = ((String)soLnValues.get(key)).split(",");System.out.println("solnValueList::"+solnValueList);
...@@ -1902,7 +1938,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -1902,7 +1938,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
+"AND INVSTAT.AVAILABLE = 'Y' " +"AND INVSTAT.AVAILABLE = 'Y' "
+"AND STOCK.ITEM_CODE = ? AND STOCK.SITE_CODE = ? " +"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 (STOCK.QUANTITY - STOCK.ALLOC_QTY - case when STOCK.HOLD_QTY is null then 0 else STOCK.HOLD_QTY end) > 0 "
+"AND NOT EXISTS (SELECT 1 FROM INV_RESTR I WHERE I.INV_STAT = INVSTAT.INV_STAT AND I.REF_SER = 'S-DSP' )" + " AND STOCK.LOC_CODE NOT IN ('D1911C ') "; +"AND NOT EXISTS (SELECT 1 FROM INV_RESTR I WHERE I.INV_STAT = INVSTAT.INV_STAT AND I.REF_SER = 'S-DSP' ) ";// + " AND STOCK.LOC_CODE NOT IN ('D1911C ') ";
if("N".equalsIgnoreCase(activeAllow)) if("N".equalsIgnoreCase(activeAllow))
...@@ -2013,10 +2049,17 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -2013,10 +2049,17 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
rsShip.close();rsShip = null; rsShip.close();rsShip = null;
System.out.print(":: qtyAvailAlloc ::"+qtyAvailAlloc); System.out.print(":: qtyAvailAlloc ::"+qtyAvailAlloc);
System.out.print(":: shipperSizeLot ::"+shipperSizeLot); System.out.print(":: shipperSizeLot ::"+shipperSizeLot);
double sz = 0; double sz = 0;
if("N".equalsIgnoreCase(activeAllow)) if("N".equalsIgnoreCase(activeAllow))
{ {
sz = qtyAvailAlloc % shipperSizeLot; if(shipperSizeLot <= 0d)
sz = 0;
else
sz = qtyAvailAlloc % shipperSizeLot;
if(qtyAvailAlloc > shipperSizeLot)
sz= 0;
}else }else
{ {
sz = 0; sz = 0;
...@@ -2027,25 +2070,26 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -2027,25 +2070,26 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
if("N".equalsIgnoreCase(singleLot.trim())) if("N".equalsIgnoreCase(singleLot.trim()))
{ {
totalQtyAvailAlloc = totalQtyAvailAlloc + qtyAvailAlloc ; totalQtyAvailAlloc = totalQtyAvailAlloc + qtyAvailAlloc ;
System.out.println("totalQtyAvailAlloc::"+totalQtyAvailAlloc);
if(totalQtyAvailAlloc >= allocQty) if(totalQtyAvailAlloc >= allocQty)
{ {
isQtyAvail = true; isQtyAvail = true;getLotFlag = true;
lotDeatilList.add(lotNo+"@"+lotSl+"@"+locCode+"@"+unit+"@"+qtyAvailAlloc+"@"+grade+"@"+convQtyStduom+"@"+quantity+"@"+siteCodeMfg); // lotDeatilList.add(lotNo+"@"+lotSl+"@"+locCode+"@"+unit+"@"+qtyAvailAlloc+"@"+grade+"@"+convQtyStduom+"@"+quantity+"@"+siteCodeMfg);
} }
// lotDeatilList.add(lotNo+"@"+lotSl+"@"+locCode+"@"+unit+"@"+qtyAvailAlloc+"@"+grade+"@"+convQtyStduom+"@"+quantity+"@"+siteCodeMfg); lotDeatilList.add(lotNo+"@"+lotSl+"@"+locCode+"@"+unit+"@"+qtyAvailAlloc+"@"+grade+"@"+convQtyStduom+"@"+quantity+"@"+siteCodeMfg);
System.out.println("lotDeatilList1 ::"+lotDeatilList); System.out.println("lotDeatilList1 ::"+lotDeatilList);
} }
System.out.println("lotDeatilList2 ::"+lotDeatilList); System.out.println("lotDeatilList2 ::"+lotDeatilList);
//ADDED BY RITESH ON 16/07/14 START //ADDED BY RITESH ON 16/07/14 START
if("Y".equalsIgnoreCase(singleLot.trim())) if("Y".equalsIgnoreCase(singleLot.trim())) // CURRECT FINALLY
{ {
System.out.println("singleLot y CONDITION ::"); System.out.println("singleLot N CONDITION ::");
if(stockLot.containsKey(lotNo)) if(stockLot.containsKey(lotNo))
{ {
System.out.println("singleLot y CONDITION IF ::"); System.out.println("singleLot N CONDITION IF ::");
stockLot.put(lotNo, ((Double)stockLot.get(lotNo)+qtyAvailAlloc)); stockLot.put(lotNo, ((Double)stockLot.get(lotNo)+qtyAvailAlloc));
ArrayList<String> stockList=new ArrayList<String>(); ArrayList<String> stockList=new ArrayList<String>();
stockList=stockLotDetail.get(lotNo); stockList=stockLotDetail.get(lotNo);
...@@ -2056,7 +2100,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -2056,7 +2100,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
} }
else else
{ {
System.out.println("singleLot y CONDITION ELSE ::"); System.out.println("singleLot N CONDITION ELSE ::");
stockLot.put(lotNo,qtyAvailAlloc); stockLot.put(lotNo,qtyAvailAlloc);
ArrayList<String> stockList=new ArrayList<String>(); ArrayList<String> stockList=new ArrayList<String>();
...@@ -2100,13 +2144,18 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -2100,13 +2144,18 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
} }
System.out.println(" lotDeatilList ::"+lotDeatilList); System.out.println(" lotDeatilList ::"+lotDeatilList);
System.out.println(" isQtyAvail ::["+isQtyAvail+"]"); System.out.println(" isQtyAvail ::["+isQtyAvail+"]");
if(isQtyAvail == false)
{
errFlag = true;
}
if(lotDeatilList.size() > 0 && isQtyAvail) if(lotDeatilList.size() > 0 && isQtyAvail)
{ {
if(isHdr) if(isHdr)
{ {
System.out.println("New Record Inserting*********============***********"); System.out.println("New Record Inserting*****250814****============***********");
isHdr = false;
isdetFlag = false;
xmlBuff = new StringBuffer(); xmlBuff = new StringBuffer();
xmlBuff.append("<?xml version='1.0' encoding='ISO-8859-1'?>\n"); xmlBuff.append("<?xml version='1.0' encoding='ISO-8859-1'?>\n");
xmlBuff.append("<DocumentRoot>"); xmlBuff.append("<DocumentRoot>");
...@@ -2133,6 +2182,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -2133,6 +2182,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
xmlBuff.append("<TRAN_DATE><![CDATA["+ sdf.format(sysDate) +"]]></TRAN_DATE>"); xmlBuff.append("<TRAN_DATE><![CDATA["+ sdf.format(sysDate) +"]]></TRAN_DATE>");
xmlBuff.append("<cust_code><![CDATA["+ custCode +"]]></cust_code>"); xmlBuff.append("<cust_code><![CDATA["+ custCode +"]]></cust_code>");
xmlBuff.append("<sale_order><![CDATA["+ saleOrder +"]]></sale_order>"); xmlBuff.append("<sale_order><![CDATA["+ saleOrder +"]]></sale_order>");
siteCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
xmlBuff.append("<site_code><![CDATA["+ siteCode +"]]></site_code>");// xmlBuff.append("<site_code><![CDATA["+ siteCode +"]]></site_code>");//
xmlBuff.append("<site_code__ship><![CDATA["+ siteCodeShip +"]]></site_code__ship>"); xmlBuff.append("<site_code__ship><![CDATA["+ siteCodeShip +"]]></site_code__ship>");
xmlBuff.append("<chg_date><![CDATA["+sdf.format(sysDate)+"]]></chg_date>"); xmlBuff.append("<chg_date><![CDATA["+sdf.format(sysDate)+"]]></chg_date>");
...@@ -2147,6 +2197,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -2147,6 +2197,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
xmlBuff.append("</Detail1>"); xmlBuff.append("</Detail1>");
} }
HashMap mapDet = new HashMap(); HashMap mapDet = new HashMap();
boolean errItemAddFlag = false;
for(int i = 0; i < lotDeatilList.size();i++) for(int i = 0; i < lotDeatilList.size();i++)
{ {
...@@ -2194,18 +2245,36 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -2194,18 +2245,36 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
} }
else else
{ {
boolean shipperSizeFlag = true;
sqls = "select shipper_size from item_lot_packsize where item_code = ? and '"+lotNo+"' between lot_no__from and lot_no__to"; sqls = "select shipper_size from item_lot_packsize where item_code = ? and '"+lotNo+"' between lot_no__from and lot_no__to";
pstmt = conn.prepareStatement(sqls); pstmt = conn.prepareStatement(sqls);
pstmt.setString(1,itemCode); pstmt.setString(1,itemCode);
rs1 = pstmt.executeQuery(); rs1 = pstmt.executeQuery();
if(rs1.next()) if(rs1.next())
{ {
shipperSizeFlag = false;
shipperSize = rs1.getDouble(1); shipperSize = rs1.getDouble(1);
} }
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
rs1.close();rs1 = null; rs1.close();rs1 = null;
System.out.print(":: qtyAvailAlloc ::"+qtyAvailAlloc); System.out.print(":: qtyAvailAlloc ::"+qtyAvailAlloc);
System.out.print(":: shipperSize ::"+shipperSize); System.out.print(":: shipperSize ::"+shipperSize);
if(shipperSizeFlag && shipperSize <=0d)
{
errFlag = true;
shiperSizeError = "SHIPPERSIZEERR";
System.out.println("shiperSizeError::["+shiperSizeError+"]");
if(errItemAddFlag == false)
{
list2.add(saleOrder);
list2.add(lineNo);
list2.add(itemCode);
list2.add(allocQty);
errItemAddFlag = true;
elements2 ++; System.out.println("elements2 ++ shiperSizeError ::"+elements2);
}
}
System.out.println("shiperSizeError::"+shiperSizeError);
if(qtyAvailAlloc >= shipperSize ) if(qtyAvailAlloc >= shipperSize )
{ {
int div = 0; int div = 0;
...@@ -2321,6 +2390,16 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -2321,6 +2390,16 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
// xmlBuff.append("<pending_qty><![CDATA["+ qty +"]]></pending_qty>"); // xmlBuff.append("<pending_qty><![CDATA["+ qty +"]]></pending_qty>");
// xmlBuff.append("</Detail2>"); // xmlBuff.append("</Detail2>");
} }
else if(errItemAddFlag == false)
{
list2.add(saleOrder);
list2.add(lineNo);
list2.add(itemCode);
list2.add(allocQty);
errItemAddFlag = true;
elements2 ++; System.out.println("elements2 ++ lotQtyToBeAllocated ::"+elements2);
}
}//end of while }//end of while
System.out.println("mapDet::"+mapDet); System.out.println("mapDet::"+mapDet);
...@@ -2332,6 +2411,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -2332,6 +2411,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
System.out.println("lotKey ::mapDet:: [-"+lotKey+"-]"); System.out.println("lotKey ::mapDet:: [-"+lotKey+"-]");
while(lot.hasNext()) while(lot.hasNext())
{ {
isdetFlag = true;
String lotKeyVal=lot.next(); String lotKeyVal=lot.next();
String detStr = (String)mapDet.get(lotKeyVal); String detStr = (String)mapDet.get(lotKeyVal);
String[] detHdr = detStr.split(","); String[] detHdr = detStr.split(",");
...@@ -2354,6 +2434,13 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -2354,6 +2434,13 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
} }
} }
} }
else{
list2.add(saleOrder);
list2.add(lineNo);
list2.add(itemCode);
list2.add(allocQty);
elements2 ++;System.out.println("elements2 ++ empty list ::"+elements2);
}
} }
if(xmlBuff!=null) if(xmlBuff!=null)
{ {
...@@ -2369,8 +2456,10 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -2369,8 +2456,10 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
System.out.println("==site code =="+siteCode); System.out.println("==site code =="+siteCode);
System.out.println("Printing xmlString"+xmlString); System.out.println("Printing xmlString"+xmlString);
System.out.println("Going to save data method++++++++++++++++++++++++"); System.out.println("Going to save data method++++++++++++++++++++++++");
if(xmlString != null && xmlString.trim().length()>0 && isdetFlag)
retString = saveData(siteCode,xmlString,conn); {
retString = saveData(siteCode,xmlString,conn);
}
System.out.println("@@@@@2: retString11111111111:"+retString); System.out.println("@@@@@2: retString11111111111:"+retString);
if (retString.indexOf("Success") > -1) if (retString.indexOf("Success") > -1)
{ {
......
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