Commit c938b9b4 authored by cpatil's avatar cpatil

merge n remove error


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95013 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9015763e
......@@ -87,6 +87,7 @@ class ADPElement
//private HashMap<String, ADPElement> detMap=new HashMap<String, ADPElement>();
private ArrayList<HashMap<String, ADPElement>> detList=new ArrayList<HashMap<String, ADPElement>>();
private String empCodePlan;//Manoj dtd 11/03/2014
private String originalOrAltitem;//Manoj dtd 30/04/2014 to check whether Original/Alternate item
public ADPElement()
{
......@@ -615,7 +616,15 @@ class ADPElement
return this.empCodePlan;
}
//End Manoj dtd 11/03/2014
//Manoj dtd 30/04/2014 to check whether Original/Alternate item
public void setOriginalOrAltitem(String originalOrAltitem)
{
this.originalOrAltitem = originalOrAltitem;
}
public String getOriginalOrAltitem()
{
return this.originalOrAltitem;
}
//private void updateTimeMrp(java.sql.Timestamp dueDate, double demand, double supply, double stockQty, double othSupply, String saleOrder, String lineNo)
private void updateTimeMrp(java.sql.Timestamp dueDate, double demand, double supply, double stockQty, double othSupply)
......
......@@ -153,7 +153,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
ArrayList IPD_MPS_ORDER = new ArrayList();
ArrayList IPD_DIST = new ArrayList();
String wnName1=""; // added by chandrakant on 29/4/14
String wnName1=""; // chandrakant on 29/4/14
HashMap<String, ArrayList<String>> altitemMap=new HashMap<String, ArrayList<String>>();//Manoj dtd 30/04/2014 to store Alternate item
//String IPD_INDEPENDENT = "",IPD_INDENT = "",IPD_MPS_ORDER = "",IPD_DIST = ""; //cpatil on 15/01/14
/*
......@@ -247,7 +249,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
e1.printStackTrace();
}
this.wnName1=windowName1; // added by chandrakant on 29/4/14
this.wnName1=windowName1;
System.out.println("windowName is ==>"+windowName);
// System.out.println("Initial Size of Item Has Map :" +
// itemHashMap.size());
......@@ -1293,6 +1295,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String confirmedBom = null;
String activeBom = null;
//Added by Manoj dtd 30/04/2014 to add Alternate items in list
PreparedStatement pstmt1=null;
ResultSet rs1=null;
try
{
......@@ -1346,6 +1351,31 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
System.out.println("rs.getString(1)----" + rs.getString(1));
levelBom.add(rs.getString(1));
ctr = 1;
//Added by Manoj dtd 30/04/2014 to add Alternate items in list
pstmt1=conn.prepareStatement("SELECT DISTINCT ITEM_CODE__ALT FROM BOM_ALT WHERE BOM_CODE=? AND ITEM_CODE=?");
pstmt1.setString(1, bomCode);
pstmt1.setString(2, rs.getString(1));
rs1=pstmt1.executeQuery();
while(rs1.next())
{
ArrayList<String > al=al=new ArrayList<String>();;
if(altitemMap.containsKey(rs.getString(1)))
{
al=altitemMap.get(rs.getString(1));
}
al.add(rs1.getString(1));
altitemMap.put(rs.getString(1), al);
System.out.println("1347---altitemMap.size()----"+altitemMap.size()+"----"+al.get(0)+"---altitemMap---"+altitemMap);
//al.clear();
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null;
//Ended by Manoj dtd 30/04/2014 to add Alternate items in list
}
level = level + ctr;
hmap.put(new Integer(level), levelBom);
......@@ -1994,6 +2024,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
ResultSet rs = null;
Set setItem = itemCodeMap.entrySet();
//Added by Manoj dtd 30/04/2014 to add Alternate items in list
Iterator itrAltItem = null;
Set setAltItem=altitemMap.keySet();
System.out.println("altitemMap----"+altitemMap);
System.out.println("setAltItem----"+setAltItem);
// System.out.println("In populateADPElementList()");
try
{
......@@ -2009,7 +2045,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
siteCode = (String) siteMapEntry.getKey();
itemCode = (String) itemMapEntry.getKey();
//Manoj dtd 30/04/2014 to set Original/Alternate item flag
adpElement.setOriginalOrAltitem("O");
// 01/04/11 in case of made to order only made to order item
// will be planned
/*
......@@ -2060,6 +2097,34 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if (adpElement != null)
adpeList.add(adpElement);
}
//Added by Manoj dtd 30/04/2014 to add Alternate items in list
itrAltItem=setAltItem.iterator();
while(itrAltItem.hasNext())
{
//System.out.println(" itrAltItem.next()---"+ (String) itrAltItem.next());
String keyAlttem=(String) itrAltItem.next();
System.out.println("keyAlttem----"+keyAlttem);
ArrayList<String> altItemlist=altitemMap.get(keyAlttem);
System.out.println("altItemlist.size()----"+altItemlist.size());
for(int i=0;i<altItemlist.size();i++)
{
System.out.println("altItemlist.get(i)----"+altItemlist.get(i));
adpElement = new ADPElement();
adpElement.setOriginalOrAltitem("A");
adpElement.setSiteCode((String) siteMapEntry.getKey());
adpElement.setItemCode(altItemlist.get(i));
adpElement = setAdpeValues(adpElement);
adpeList.add(adpElement);
}
//Ended by Manoj dtd 30/04/2014 to add Alternate items in list
//if (adpElement != null)
}
}
populateADPList();// Added by Jiten 09/11/06
} catch (Exception e)
......@@ -2785,7 +2850,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
System.out.println("wnName1["+wnName1+"]");
if(wnName1.trim().equals("w_requirement")) // added by chandrakant on 29/4/14 as per suggestion
if(wnName1.trim().equals("w_requirement"))
{
sqlFileName = CommonConstants.JBOSSHOME + File.separator + "sql" + File.separator + "demandsupplymaterialReq";
}
......@@ -3637,6 +3702,23 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// Jiten
// 13/11/06
// -
//Added by Manoj dtd 30/04/2014 to set Alternate items in xml
String tmpAltitemlist="";
for(int ctr=0;ctr<adpeList.size();ctr++)
{
ADPElement tmpADPElement=(ADPElement) adpeList.get(ctr);
if("A".equalsIgnoreCase(tmpADPElement.getOriginalOrAltitem()))
{
tmpAltitemlist+="<Detail><site_code>"+tmpADPElement.getSiteCode()+"</site_code><bom_code>"+tmpADPElement.getBomCode()+"</bom_code><item_code>"+tmpADPElement.getItemCode()+"</item_code><item_Ref>"+tmpADPElement.getItemCode()+"</item_Ref><quantity_Ref>0</quantity_Ref><quantity>0</quantity><due_date>2014-01-06</due_date><exp_lev>1</exp_lev><operation>1</operation><crit_Item>Y</crit_Item><line_type>I</line_type></Detail>";
}
}
retXMLStr=retXMLStr.substring(0, retXMLStr.length()-7);
retXMLStr=retXMLStr+tmpAltitemlist+"</Root>";
//"<Detail><site_code>PL001</site_code><bom_code>M070400G.1</bom_code><item_code>US15012UVG</item_code><item_Ref>US15012UVG </item_Ref><quantity_Ref>825.0</quantity_Ref><quantity>528.0</quantity><due_date>2014-01-05</due_date><exp_lev>1.10.</exp_lev><operation>1</operation><crit_Item>Y</crit_Item><line_type>I</line_type></Detail>";
if (itemCode.trim().equals("BF21135"))
{
System.out.println("14012009 itemCode [" + itemCode + "] explodeBomObj retXMLStr [" + retXMLStr + "]");
......@@ -8590,4 +8672,4 @@ class CyclicItem
*
* } catch(Exception e) { System.out.println("Exception [InsertPlanDemand] : " +
* e); e.printStackTrace(); errString = e.getMessage(); } return errString; }
*/
\ No newline at end of file
*/
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