Commit c1cb7ac8 authored by pgole's avatar pgole

Updated EJB FOR CUST STOCK issue


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@103974 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 630ed2ef
...@@ -256,6 +256,7 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo ...@@ -256,6 +256,7 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo
ArrayList tempList = null; ArrayList tempList = null;
Timestamp morderDt = null ; Timestamp morderDt = null ;
PreparedStatement pstmt = null,pstmt1 =null ,pstmt2 =null ,pstmtDet = null; PreparedStatement pstmt = null,pstmt1 =null ,pstmt2 =null ,pstmtDet = null;
ResultSet rs = null,rs1 =null ,rs2 = null ,rsDet = null; ResultSet rs = null,rs1 =null ,rs2 = null ,rsDet = null;
...@@ -940,6 +941,8 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo ...@@ -940,6 +941,8 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo
lsOrderType = tempOrderType ; lsOrderType = tempOrderType ;
} }
System.out.println("lsOrderType "+lsOrderType);
custStockSoGen.put("order_type", lsOrderType); custStockSoGen.put("order_type", lsOrderType);
custStockSoGen.put("invoice_item_ser", invoiceItemSer); custStockSoGen.put("invoice_item_ser", invoiceItemSer);
custStockSoGen.put("loc_type", mlocType); custStockSoGen.put("loc_type", mlocType);
...@@ -953,7 +956,7 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo ...@@ -953,7 +956,7 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo
custStockSoGen.put("cust_item__ref", custItemRef); custStockSoGen.put("cust_item__ref", custItemRef);
custStockSoGen.put("order_stock", orderStock); custStockSoGen.put("order_stock", orderStock);
System.out.println("Inside for for loop ["+custStockSoGenList.size() + "] "); System.out.println("Inside for for loop ["+custStockSoGenList.size() + "]lsOrderType "+lsOrderType);
sql = "Select descr from item where item_code = ? "; sql = "Select descr from item where item_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -1753,15 +1756,17 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo ...@@ -1753,15 +1756,17 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo
} }
System.out.println("NewCustStockSoGenList ["+NewCustStockSoGenList.size()+"]"); System.out.println("NewCustStockSoGenList ["+NewCustStockSoGenList.size()+"]");
//System.out.println("NewCustStockSoGenList ["+NewCustStockSoGenList.toString()+"]");
if(NewCustStockSoGenList.size() > 0) if(NewCustStockSoGenList.size() > 0)
{ {
schpercTmp = (Double) schpercList.get(0) ; schpercTmp = (Double) schpercList.get(0) ;
for(k = 0 ; k < schdtList.size() ; k++) for(k = 0 ; k < schdtList.size() ; k++)
{ {
HashMap splitCodeWiseMap = new HashMap(); HashMap splitCodeWiseMap = new HashMap();
//tempList = new ArrayList();
System.out.println("INSIDE NewCust K LOOP"+ k); System.out.println("INSIDE NewCust K LOOP"+ k);
int q = 0 ; int q = 0 ;
...@@ -1772,6 +1777,11 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo ...@@ -1772,6 +1777,11 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo
custStockSoGen = (HashMap) NewCustStockSoGenList.get(q); custStockSoGen = (HashMap) NewCustStockSoGenList.get(q);
schdtList = tschdtList ; schdtList = tschdtList ;
schpercList = tschpercList ; schpercList = tschpercList ;
if(custStockSoGen.size() > 0)
{
System.out.println("custStockSoGen ... ["+custStockSoGen.toString()+"]");
}
if(!"P".equalsIgnoreCase(asType)) if(!"P".equalsIgnoreCase(asType))
{ {
...@@ -1872,7 +1882,7 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo ...@@ -1872,7 +1882,7 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo
orderType = (String) custStockSoGen.get("order_type"); orderType = (String) custStockSoGen.get("order_type");
System.out.println("Before DETAIL2 LOG["+ NewCustStockSoGenList.size()+"]"); System.out.println("Before DETAIL2 LOG["+ NewCustStockSoGenList.size()+"]orderType"+orderType);
/*for(int j = q ;j< NewCustStockSoGenList.size(); j++) /*for(int j = q ;j< NewCustStockSoGenList.size(); j++)
{ {
...@@ -2192,9 +2202,11 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo ...@@ -2192,9 +2202,11 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo
System.out.println("@@@@@ :Inside locType.trim().....["+locType.trim()+"]itemserProm["+itemserProm+"]"); System.out.println("@@@@@ :Inside locType.trim().....["+locType.trim()+"]itemserProm["+itemserProm+"]");
tempSplitCode = itemserProm + "@" + locType.trim(); tempSplitCode = itemserProm + "@" + locType.trim();
splitCodeWiseMap = new HashMap(); //splitCodeWiseMap = new HashMap();
System.out.println("splitCodeWiseMap"+splitCodeWiseMap.toString()); System.out.println("tempSplitCode......"+tempSplitCode);
System.out.println("splitCodeWiseMap"+splitCodeWiseMap.size());
System.out.println("tempList before["+tempList+"][tempList["+tempList +"]\n");
if (splitCodeWiseMap.containsKey(tempSplitCode)) if (splitCodeWiseMap.containsKey(tempSplitCode))
{ {
tempList = (ArrayList) splitCodeWiseMap.get(tempSplitCode); tempList = (ArrayList) splitCodeWiseMap.get(tempSplitCode);
...@@ -2203,9 +2215,11 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo ...@@ -2203,9 +2215,11 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo
} else } else
{ {
tempList = new ArrayList(); tempList = new ArrayList();
//tempList.add(custStockSoGen);
System.out.println("@@@@@ tempList in else....."+tempList); System.out.println("@@@@@ tempList in else....."+tempList);
} }
System.out.println("tempList after["+tempList+"][tempList["+tempList +"]");
tempMap = new HashMap(); tempMap = new HashMap();
System.out.println("LINE NO PLAN["+lineNo+"][LINE NO SET["+msetLine +"]"); System.out.println("LINE NO PLAN["+lineNo+"][LINE NO SET["+msetLine +"]");
...@@ -2257,12 +2271,15 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo ...@@ -2257,12 +2271,15 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo
System.out.println("sales parson = " + tempMap.size() ); System.out.println("sales parson = " + tempMap.size() );
tempList.add(tempMap); tempList.add(tempMap);
System.out.println("Print Templist["+ tempList + "]"); System.out.println("Print Templist["+ tempList + "]");
System.out.println(" Templist["+ tempList.size() + "]"); System.out.println(" Templist["+ tempList.size() + "]");
System.out.println(" splitCodeWiseMap ["+ splitCodeWiseMap + "]");
//for(int r = 0 ; r < tempList.size();r++ )
//{
System.out.println("Inside templist size");
if (splitCodeWiseMap.containsKey(tempSplitCode)) if (splitCodeWiseMap.containsKey(tempSplitCode))
{ {
splitCodeWiseMap.put(tempSplitCode, tempList); splitCodeWiseMap.put(tempSplitCode, tempList);
...@@ -2270,6 +2287,7 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo ...@@ -2270,6 +2287,7 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo
{ {
splitCodeWiseMap.put(tempSplitCode, tempList); splitCodeWiseMap.put(tempSplitCode, tempList);
} }
//}
System.out.println("Print splitCodeWiseMap"+ splitCodeWiseMap); System.out.println("Print splitCodeWiseMap"+ splitCodeWiseMap);
System.out.println("Print splitCodeWiseMap>>["+ splitCodeWiseMap.size()+"]"); System.out.println("Print splitCodeWiseMap>>["+ splitCodeWiseMap.size()+"]");
...@@ -2287,6 +2305,7 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo ...@@ -2287,6 +2305,7 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo
System.out.println("tempList before while >>>["+tempList +"] "+itrItem.toString()); System.out.println("tempList before while >>>["+tempList +"] "+itrItem.toString());
int w = 0 ; int w = 0 ;
String ordType = "";
while (itrItem.hasNext()) while (itrItem.hasNext())
{ {
if(tempList != null && tempList.size() > 0) if(tempList != null && tempList.size() > 0)
...@@ -2314,8 +2333,8 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo ...@@ -2314,8 +2333,8 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo
// modify by cpatil on 14-06-12 for splitting start // modify by cpatil on 14-06-12 for splitting start
//int crIndex = splitCode.indexOf('.'); //int crIndex = splitCode.indexOf('.');
//crTerm = splitCode.substring(custIndex + 1, crIndex); //crTerm = splitCode.substring(custIndex + 1, crIndex);
//String locTypeParent = splitCode.substring(crIndex + 1, splitCode.length()); String locTypeParent = splitCode.substring(itemIndex + 1, splitCode.length());
//System.out.println(">>>>>>>>>locTypeParent===" + locTypeParent); System.out.println(">>>>>>>>>locTypeParent===" + locTypeParent);
System.out.println("INSIDE WHILE...."); System.out.println("INSIDE WHILE....");
System.out.println("SDF DATE"+sdf.format(morderDt)); System.out.println("SDF DATE"+sdf.format(morderDt));
...@@ -2336,6 +2355,25 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo ...@@ -2336,6 +2355,25 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo
System.out.println("tempList111>>>>[" + tempList.size() + "]"+"["+tempList+"]"); System.out.println("tempList111>>>>[" + tempList.size() + "]"+"["+tempList+"]");
sql = " select order_type from sordertype where loc_type__parent=?";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, locTypeParent);
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
ordType = checkNull(rs1.getString("order_type"));
}
pstmt1.close();
pstmt1 = null;
rs1.close();
rs1 = null;
if (ordType == null || ordType.trim().length() == 0)
{
ordType = orderType;
}
System.out.println("ordType>>>>"+ordType);
xmlBuff = null; xmlBuff = null;
xmlBuff = new StringBuffer(); xmlBuff = new StringBuffer();
...@@ -2361,7 +2399,7 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo ...@@ -2361,7 +2399,7 @@ public class CustStockOrder extends ActionHandlerEJB implements CustStockOrderLo
xmlBuff.append("<Detail1 dbID=\"\" domID=\"1\" objName=\"sorder\" objContext=\"1\">"); xmlBuff.append("<Detail1 dbID=\"\" domID=\"1\" objName=\"sorder\" objContext=\"1\">");
xmlBuff.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>"); xmlBuff.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>");
xmlBuff.append("<order_type><![CDATA["+ checkNull(orderType )+"]]></order_type>"); xmlBuff.append("<order_type><![CDATA["+ checkNull(ordType)+"]]></order_type>");
//xmlBuff.append("<sale_order><![CDATA["+ checkNull(msetTranId )+"]]></sale_order>"); //xmlBuff.append("<sale_order><![CDATA["+ checkNull(msetTranId )+"]]></sale_order>");
xmlBuff.append("<sale_order/>"); xmlBuff.append("<sale_order/>");
xmlBuff.append("<order_date><![CDATA["+ morderDtApp +"]]></order_date>"); xmlBuff.append("<order_date><![CDATA["+ morderDtApp +"]]></order_date>");
......
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