Commit d3bd31ad authored by cpatil's avatar cpatil

modify at urse supreme


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97719 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 491dcabd
......@@ -104,6 +104,58 @@ class ADPElement implements Cloneable
private double soDemand=0;
private double grossWeight = 0;
private String altitemPerc;
private double reorderLevel=0;
private double reordPlanQty=0;
public void setDemand(double demand)
{
this.demand=demand;
}
/*public double getDemand()
{
return this.demand;
}*/
public void setSupply(double supply)
{
this.supply=supply;
}
/*public double getSupply()
{
return this.supply;
}*/
public double getReordPlanQty()
{
return this.reordPlanQty;
}
/*public double getDemand()
{
return this.demand;
}*/
public void setReordPlanQty(double reordPlanQty)
{
this.reordPlanQty=reordPlanQty;
}
public void SetTimeMRPArr(ArrayList timeMRPArr)
{
this.timeMRPArr=timeMRPArr;
}
public ArrayList<TimeMRP> getTimeMRPArr()
{
return this.timeMRPArr;
}
public void setReorderLevel(double reorderLevel)
{
this.reorderLevel=reorderLevel;
}
public double getReorderLevel()
{
return this.reorderLevel;
}
public void setAltitemPerc(String altitemPerc)
{
......@@ -350,8 +402,17 @@ class ADPElement implements Cloneable
public void setSupply(java.sql.Timestamp dueDate, double supply)
{
this.supply += supply;
System.out.println("@@@@@020415:::this.reorderLevel["+this.reorderLevel+"]");
//updateTimeMrp(dueDate, 0, supply, 0, 0," "," ");
/*if(this.reorderLevel>0)
{
updateTimeMrp(dueDate, 0, supply, 0, 0,reorderLevel);
}
else
{*/
updateTimeMrp(dueDate, 0, supply, 0, 0);
//}
}
public double getSupply()
{
......@@ -835,6 +896,106 @@ class ADPElement implements Cloneable
errString = e.getMessage();
}
}
private void updateTimeMrp(java.sql.Timestamp dueDate, double demand, double supply, double stockQty, double othSupply,double reorderLevel)
{
String errString = "";
TimeMRP timeMRP = null;
genericUtility = GenericUtility.getInstance();
int timeEle = -1, ctr;
SimpleDateFormat sdt=new SimpleDateFormat("yyyy-MM-dd");
dueDate = java.sql.Timestamp.valueOf(sdt.format(dueDate) + " 00:00:00.000");
System.out.println("618---timeMRPArr.size() "+timeMRPArr.size() +"----"+dueDate+"---"+demand+"----"+supply+"----"+stockQty);
try
{
timeEle = -1;
if (timeMRPArr.size() > 0)
{
for (ctr = 0; ctr < timeMRPArr.size(); ctr++)
{
timeMRP = (TimeMRP)timeMRPArr.get(ctr);
//if (timeMRP.getDueDate() != null && timeMRP.getSaleOrder().equals(saleOrder) && timeMRP.getLineNo().equals(lineNo))
System.out.println("772--timeMRP.getDueDate()["+timeMRP.getDueDate()+"]");
if (timeMRP.getDueDate() != null)
{
if (timeMRP.getDueDate().equals(dueDate))
{
timeEle = ctr;
break;
}
}
}
}
System.out.println("637---timeEle---"+timeEle);
if (timeEle == -1)
{
timeMRP = new TimeMRP();
timeMRP.setDueDate(dueDate);
//added by sabyasachi 29.03.2011
//timeMRP.setDemand(demand,saleOrder,lineNo);
System.out.println("@@@@@@@@@@@ timeMRP -1 setdemand["+demand+"]");
if( demand > 0 )
{
System.out.println("@@@@@010415:::demand["+demand+"]supply["+supply+"]-reorderLevel["+reorderLevel+"]");
timeMRP.setDemand( demand - supply + reorderLevel ) ;
System.out.println("@@@@@010415:::tmp.getDemand()["+timeMRP.getDemand()+"]");
//tmp.setRunningDemand(reorderLevel);
timeMRP.setRunningDemand( demand - supply + reorderLevel );
System.out.println("@@@@@010415:::tmp.getRunningDemand()["+timeMRP.getRunningDemand()+"]");
}
// timeMRP.setDemand(demand);
//end added by sabyasachi 29.03.2011
timeMRP.setSupply(supply);
// 12/04/10 manoharan MF90BHU001
timeMRP.setStockQty(stockQty);
timeMRP.setOthSupply(othSupply);
// end 12/04/10 manoharan MF90BHU001
this.timeMRPArr.add(timeMRP);
}
else
{
timeMRP = (TimeMRP)this.timeMRPArr.get(timeEle);
//added by sabyasachi 29.03.2011
//timeMRP.setDemand(demand,saleOrder,lineNo);
System.out.println("before setDemand() [" + demand + "] supply [" + supply + "]" );
if( demand > 0 )
{
System.out.println("@@@@@010415:::demand["+demand+"]supply["+supply+"]-reorderLevel["+reorderLevel+"]");
timeMRP.setDemand( demand - supply + reorderLevel ) ;
System.out.println("@@@@@010415:::tmp.getDemand()["+timeMRP.getDemand()+"]");
//tmp.setRunningDemand(reorderLevel);
timeMRP.setRunningDemand( demand - supply + reorderLevel );
System.out.println("@@@@@010415:::tmp.getRunningDemand()["+timeMRP.getRunningDemand()+"]");
}
//timeMRP.setDemand(demand);
//end added by sabyasachi 29.03.2011
timeMRP.setSupply(supply);
System.out.println("after setSupply()" );
// 12/04/10 manoharan MF90BHU001
timeMRP.setStockQty(stockQty);
timeMRP.setOthSupply(othSupply);
// end 12/04/10 manoharan MF90BHU001
//timeMRP.setSaleOrder(saleOrder);
//timeMRP.setLineNo(lineNo);
this.timeMRPArr.set(timeEle,timeMRP);
}
System.out.println("before updateRunningDemandSupply()" );
updateRunningDemandSupply(dueDate);
System.out.println("after updateRunningDemandSupply()" );
}
catch(Exception e)
{
System.out.println("Exception :adpeLEMENT : updateTimeMrp(Date, supply, demand):...." + e.getMessage() + ":");
errString = genericUtility.createErrorString(e);
e.printStackTrace();
errString = e.getMessage();
}
}
private void updateRunningDemandSupply(java.sql.Timestamp dueDate)
{
int index = 0;
......
......@@ -102,14 +102,12 @@ public class MRPWizardXmlDataBean
HashMap detail4ListMap = new HashMap();
//System.out.println("@@@ initiaalize detail4ListMap...");
String locGroup="",mfgType="",other="",grossWeight="",netReq="",orderType="",currentSorder="",itemDetailsInfo="";
String sodemand="";
int nextDomId = 0;
String altItemPerc="";
int nextDomId = 0,soItemListCnt=0;
String altItemPerc="",soItemList="",itemCodeSuppDescr="",locGroupList="";
try
{
conn = connDriver.getConnectDB("DriverITM");
......@@ -159,6 +157,7 @@ public class MRPWizardXmlDataBean
if("line_no".equalsIgnoreCase( refrenceNode.getNodeName()))
{
lineNo = refrenceNode.getTextContent();
System.out.println("@@@@@@@@ lineNo["+lineNo+"] found....");
}
if("item_code".equalsIgnoreCase( refrenceNode.getNodeName()))
{
......@@ -172,6 +171,12 @@ public class MRPWizardXmlDataBean
{
bomCodeRef = refrenceNode.getTextContent();
}
if("loc_group".equalsIgnoreCase( refrenceNode.getNodeName()))
{
locGroup = refrenceNode.getTextContent();
System.out.println("@@@@@@@@ locGroup["+locGroup+"] found....");
}
String LineNo = "",QtyReqd = "",ItemCodeDescr = "",AvailableSupply = "",OriginalOrAltitem = "";
......@@ -375,6 +380,42 @@ public class MRPWizardXmlDataBean
}
}
// start 24/03/15 in urse by cpatil
System.out.println("soItemListCnt["+soItemListCnt+"]saleOrder["+saleOrder+"]itemCode["+itemCode+"]soItemList["+soItemList+"]locGroup["+locGroup+"]");
if( saleOrder != null && saleOrder.trim().length() > 0 && itemCode != null && itemCode.trim().length() > 0)
{
if(!( soItemList.contains(saleOrder+"@"+itemCode) ))
{
if(soItemListCnt > 0)
{
soItemList = soItemList + ","+saleOrder+"@"+itemCode+"" ;
soItemListCnt++;
}
else
{
soItemList = saleOrder+"@"+itemCode ;
soItemListCnt++;
}
}
}
System.out.println("@@@@@@ final :::soItemList in recalculate::["+soItemList+"]");
if( saleOrder != null && saleOrder.trim().length() > 0 && locGroup != null && locGroup.trim().length() > 0)
{
if( locGroupList != null && locGroupList.trim().length() > 0)
{ //locGroupList = locGroupList + ",'"+saleOrder+itemCode+"@"+locGroup+"'" ;
locGroupList = locGroupList + ","+checkNull(saleOrder).trim()+"@"+checkNull(locGroup).trim()+"" ;
}
else
{
//locGroupList = "'"+saleOrder+itemCode+"@"+locGroup+"'" ;
locGroupList = ""+checkNull(saleOrder).trim()+"@"+checkNull(locGroup).trim()+"" ;
}
}
System.out.println("@@@@@@ final :::locGroupList in recalculate::["+locGroupList+"]");
// end
System.out.println("detail4OuterList["+detail4OuterList+"]");
if( detail4OuterList != null && detail4OuterList.size() > 0 )
......@@ -532,7 +573,7 @@ public class MRPWizardXmlDataBean
}
// }
System.out.println("@@@@ saleOrder["+saleOrder+"]-lineNo["+lineNo+"]-qtyReqd["+qtyReqdStr+"]sourceSupply["+sourceSupply+"]@@@");
System.out.println("@@@@ saleOrder["+saleOrder+"]-lineNo["+lineNo+"]-qtyReqd["+qtyReqdStr+"]sourceSupply["+sourceSupply+"]locGroup["+locGroup+"]@@@");
System.out.println("@@@@ siteCode["+siteCode+"]-itemCode["+itemCode+"]-bomCodeOrg["+bomCodeOrg+"]-bomCodeRef["+bomCodeRef+"]bomCodeParent["+bomCodeParent+"]");
System.out.println("@@@@@ itemCodeDetailMap in bean itemCodeDetailMapStr["+itemCodeDetailMapStr+"]bomCodeRef["+bomCodeRef+"]");
System.out.println("@@@@@ itemCodeDetailMap in bean deleteBomList["+deleteBomList+"]deleteSaleOrderList["+deleteSaleOrderList+"]");
......@@ -542,7 +583,9 @@ public class MRPWizardXmlDataBean
itemCodeDetailMapStr = bomCodeParent;
}
System.out.println("@@@@@ itemCodeDetailMap in bean itemCode["+itemCode+"]bomCodeParent["+bomCodeParent+"]deleteBomList["+deleteBomList+"]deleteSaleOrderList["+deleteSaleOrderList+"]saleOrder@lineNo["+saleOrder+"@"+lineNo+"]bomCodeRef["+bomCodeRef+"]bomCodeOrg["+bomCodeOrg+"]");
if( !( ( deleteBomList.contains(bomCodeParent.trim()) ) && deleteSaleOrderList.contains(saleOrder+"@"+lineNo)) )
//if( !( ( deleteBomList.contains(bomCodeParent.trim()) ) && deleteSaleOrderList.contains(saleOrder+"@"+lineNo)) )
if( !( deleteBomList.contains(bomCodeParent.trim()) ) )
{ // ||
System.out.println("@@@@@ itemCodeDetailMapitemCode["+itemCode+"]deleteBomList["+deleteBomList+"]bomCodeOrg["+bomCodeOrg+"]");
//if( !(deleteBomList.contains(bomCodeOrg)) )
......@@ -557,7 +600,7 @@ public class MRPWizardXmlDataBean
&& ( !bomCodeOrg.equalsIgnoreCase(bomCodeRef)) ) )
{
System.out.println("@@@@@@@@ before recalcilate valueXmlString ["+valueXmlString.toString()+"]");
System.out.println("@@@@@@@@ before recalculate valueXmlString ["+valueXmlString.toString()+"]soItemList["+soItemList+"]locGroupList["+locGroupList+"]");
System.out.println("14/06/14 supreme 2 inside itemCode ["+itemCode+"]bomCodeRef["+bomCodeRef+"] suppSour [" + suppSour+"]bomCodeOrg["+bomCodeOrg+"]");
System.out.println("14/06/14 Before recalculate itemCode {" + itemCode +"] bomCodeRef [" + bomCodeRef + "] bomCodeParent [" + bomCodeParent+ "]dueDate["+dueDate+"]" );
......@@ -599,9 +642,6 @@ public class MRPWizardXmlDataBean
argData.append("<bom_code>").append(bomCodeRef).append("</bom_code>\r\n"); // added by cpatil on 17/05/14 for BomReplace
argData.append("<bomReplaceDemand>").append(qtyReqdStr).append("</bomReplaceDemand>\r\n"); // added by cpatil on 17/05/14 for BomReplace
//argData.append("<date_from>").append(simpleDateFormat.format(new Date())).append("</date_from>\r\n"); // 01-10-2007
//argData.append("<date_to>").append(simpleDateFormat.format(new Date())).append("</date_to>\r\n"); // 01-10-2007
......@@ -621,6 +661,9 @@ public class MRPWizardXmlDataBean
argData.append("<item_ser__to>").append("ZZ").append("</item_ser__to>\r\n");
argData.append("<item_code_list>").append("").append("</item_code_list>\r\n");
argData.append("<soItemList>").append("<![CDATA[").append(soItemList).append("]]>").append("</soItemList>\r\n");
argData.append("<locGroupList>").append("<![CDATA[").append(locGroupList).append("]]>").append("</locGroupList>\r\n");
argData.append("</Detail>");
argData.append("</Root>");
......@@ -692,6 +735,7 @@ public class MRPWizardXmlDataBean
sourceSupply = "";
siteCodeSupp = "";
itemCodeSupp = "";
itemCodeSuppDescr="";
itemCodeDescr = "";
lotNo = "";
lotSl = "";
......@@ -739,7 +783,7 @@ public class MRPWizardXmlDataBean
sourceSupply = "";
siteCodeSupp = "";
itemCodeSupp = "";
itemCodeDescr = "";
itemCodeSuppDescr = "";
lotNo = "";
lotSl = "";
locCode = "";
......@@ -815,11 +859,11 @@ public class MRPWizardXmlDataBean
{
if( detail4Node.getFirstChild() != null)
{
itemCodeDescr = detail4Node.getFirstChild().getNodeValue();
itemCodeSuppDescr = detail4Node.getFirstChild().getNodeValue();
}
else
{
itemCodeDescr="";
itemCodeSuppDescr="";
}
//itemCodeDescr = detail4Node.getFirstChild().getNodeValue();
}
......@@ -1015,7 +1059,7 @@ public class MRPWizardXmlDataBean
valueXmlString.append("<source_supply protect = '1'>").append("<![CDATA[" + sourceSupply + "]]>").append("</source_supply>\r\n");
valueXmlString.append("<site_code protect = '1'>").append("<![CDATA[" + siteCode + "]]>").append("</site_code>\r\n");
valueXmlString.append("<item_code protect = '1'>").append("<![CDATA[" + itemCodeSupp + "]]>").append("</item_code>\r\n");
valueXmlString.append("<item_code_descr protect = '1'>").append("<![CDATA[" + itemCodeDescr + "]]>").append("</item_code_descr>\r\n");
valueXmlString.append("<item_code_descr protect = '1'>").append("<![CDATA[" + itemCodeSuppDescr + "]]>").append("</item_code_descr>\r\n");
valueXmlString.append("<lot_no protect = '1'>").append("<![CDATA[" + lotNo + "]]>").append("</lot_no>\r\n");
valueXmlString.append("<lot_sl protect = '1'>").append("<![CDATA[" + lotSl + "]]>").append("</lot_sl>\r\n");
valueXmlString.append("<loc_code protect = '1'>").append("<![CDATA[" + locCode + "]]>").append("</loc_code>\r\n");
......@@ -1202,7 +1246,7 @@ public class MRPWizardXmlDataBean
}
}
System.out.println("14/06/14 After recalculate itemCode {" + itemCode +"] bomCodeRef [" + bomCodeRef + "] bomCodeParent [" + bomCodeParent+ "]itemCodeDetailMapStr["+itemCodeDetailMapStr+"]" );
////////////////////////////////////////////////////////
System.out.println("13/06/14 reference qtyReqdStr before["+qtyReqdStr+"]demand["+demand+"]sodemand["+sodemand+"]");
if (sodemand == null || "null".equals(sodemand) || sodemand.trim().length() == 0 )
{
......@@ -1393,6 +1437,10 @@ public class MRPWizardXmlDataBean
//}
}
else
{
System.out.println("@@@@@@this item code deletedc from display --> itemCode["+itemCode+"]qtyReqdStr["+qtyReqdStr+"]deleteBomList["+deleteBomList+"]bomCodeParent["+bomCodeParent+"]");
}
//}
//}
//}
......
......@@ -690,18 +690,29 @@ public class MrpWizPrsSaveBean
System.out.println("@@@@@ sorderArray.length["+sorderArray.length+"]");
for(int i=0;i<sorderArray.length;i++)
{
String tempSO=sorderArray[i];
System.out.println("@@@@@::: sorder ["+tempSO+"] updated next i["+i+"]....");
String tempSO="",tempLineNo="";
tempSO=sorderArray[i];
sql2 = " update sorder set alloc_flag = 'Y' where sale_order = ? ";
String sorderLineArray[]=tempSO.split(",");
System.out.println("@@@@@ sorderArray.length["+sorderArray.length+"]");
if( sorderLineArray.length > 1)
{
tempSO=sorderLineArray[0];
tempLineNo=sorderLineArray[1];
}
System.out.println("@@@@@::: sorder ["+tempSO+"]tempLineNo["+tempLineNo+"] updated next i["+i+"]....");
sql2 = " update sorditem set alloc_flag = 'Y' where sale_order = ? and ltrim(rtrim(line_no)) = ? ";
System.out.println("sql2 :"+sql2 );
pstmt2 = conn.prepareStatement(sql2);
pstmt2.setString(1,tempSO);
pstmt2.setString(2,tempLineNo);
int cnt2 = pstmt2.executeUpdate();
pstmt2.close();
pstmt2 = null;
System.out.println("@@@@@ cnt ["+cnt2+"]::: sorder ["+tempSO+"] alloc_flag [ Y ] updated sucessfully");
System.out.println("@@@@@ cnt ["+cnt2+"]:::sorditem:::sorder["+tempSO+"]tempLineNo["+tempLineNo+"]alloc_flag[Y]updated sucessfully");
}
......
package ibase.webitm.ejb.mfg;
// BD0783 replaced with BD0783 -- 14/01/09
//BD0783 replaced with BD0783 -- 14/01/09
/*
1. truncate table plan_hdr;
2. add sale_order and line_no, seq_no in plan_header
......@@ -41,7 +41,7 @@ import ibase.system.config.*;
import ibase.utility.CommonConstants;
import javax.ejb.Stateless; // added for ejb3
// 12/04/10 manoharan MF90BHU003
//12/04/10 manoharan MF90BHU003
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
......@@ -56,10 +56,10 @@ import org.w3c.dom.*;
import javax.xml.parsers.*;
// end 12/04/10 manoharan MF90BHU003
//end 12/04/10 manoharan MF90BHU003
@Stateless
// added for ejb3
//added for ejb3
public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRemote // SessionBean
{
......@@ -166,6 +166,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// HashMap <String,ArrayList>itemBomMap=new HashMap<String, ArrayList>();
HashMap <String,String>itemBomMap=new HashMap<String, String>();
HashMap <String,Set<String>>itemBomMap1=new HashMap<String, Set<String>>();
HashMap <String,Set<String>>itemBomMap2=new HashMap<String, Set<String>>();
Boolean isBomReplace = false; // added by cpatil on 17/05/14
String bomCode1="";
......@@ -212,8 +213,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String locGroupList="";
HashMap<String, String> locGroupMap = new HashMap<String, String>();
HashMap<String, String> soItemListMap = new HashMap<String, String>();
String yield="";
String soItemList="";
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException, ITMException
{
......@@ -332,13 +335,47 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
itemCodeOnlyList = genericUtility.getColumnValue("item_code_only_list", dom); // added by cpatil
//cpatil-25/08/14-System.out.println("siteList@@@@@@"+siteList);
locGroupList = genericUtility.getColumnValue("locGroupList", dom); // added by cpatil
soItemList = genericUtility.getColumnValue("soItemList", dom); // added by cpatil
System.out.println("@@@@@@soItemList["+soItemList+"]");
yield = genericUtility.getColumnValue("yield", dom);//added by chandrashekar on 05-Feb-2015
if(yield == null || yield.trim().length() == 0)
{
yield = "Y";
}
System.out.println("yield>>>>>["+yield+"]");
if( soItemList != null )
{
System.out.println("@@@@@ soItemList["+soItemList+"]");
String soItemLst[]=soItemList.split(",");
System.out.println("@@@@@ soItemLst.length["+soItemLst.length+"]");
for(int i=0;i<soItemLst.length;i++)
{
String SOrder="",tempItemCode="";
String tempsoItemLst=soItemLst[i];
System.out.println("@@@@@ tempsoItemLst["+tempsoItemLst+"]");
String tempsoItemLstArr[]=tempsoItemLst.split("@");
if( tempsoItemLstArr.length > 0 )
{
SOrder=tempsoItemLstArr[0];
}
if( tempsoItemLstArr.length > 1 )
{
tempItemCode=tempsoItemLstArr[1];
}
System.out.println("@@@@@ SOrder["+SOrder+"]tempItemCode["+tempItemCode+"]");
if( soItemListMap.containsKey(tempItemCode) )
{
String tempVal = soItemListMap.get(tempItemCode).toString();
soItemListMap.put(checkNull(tempItemCode).trim(), tempVal+","+checkNull(SOrder).trim() );
}
else
{
soItemListMap.put(checkNull(tempItemCode).trim(), checkNull(SOrder).trim() );
}
}
System.out.println("@@@@@ final soItemListMap["+soItemListMap+"]");
}
if( locGroupList != null )
{
......@@ -1741,7 +1778,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String innerBomCode = null;
PreparedStatement pstmtValidBom = null;
String sqlValidBom = "SELECT CONFIRMED, ACTIVE FROM BOM WHERE BOM_CODE = ?";
String sqlValidBom = "SELECT CONFIRMED, ACTIVE,ITEM_CODE FROM BOM WHERE BOM_CODE = ?";
ResultSet rsValidBom = null;
boolean bomExists = false;
String logMsg = null;
......@@ -1751,6 +1788,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//Added by Manoj dtd 30/04/2014 to add Alternate items in list
PreparedStatement pstmt1=null;
ResultSet rs1=null;
String bomItem="";
try
{
......@@ -1765,6 +1803,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
bomExists = true;
confirmedBom = rsValidBom.getString(1);
activeBom = rsValidBom.getString(2);
bomItem= rsValidBom.getString(3);
}
//cpatil-25/08/14-System.out.println("confirmedBom---"+confirmedBom+"---activeBom---"+activeBom);
rsValidBom.close();
......@@ -1831,6 +1870,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
itemBomMap.put(rs.getString(1), bomCode);
Set<String> bomSet=new HashSet<String>();
Set<String> itemSet=new HashSet<String>();
if(itemBomMap1.size()>0)
{
if(itemBomMap1.containsKey(itemCodeTo))
......@@ -1850,6 +1891,28 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
bomSet.add(bomCode);
}
itemBomMap1.put(itemCodeTo, bomSet);
///////////////////////////////////////
if(itemBomMap2.size()>0)
{
if(itemBomMap2.containsKey(itemCodeTo))
{
itemSet=itemBomMap2.get(itemCodeTo);
itemSet.add(bomItem);
}
else
{
itemSet=new HashSet<String>();
itemSet.add(bomItem);
}
}
else
{
itemSet=new HashSet<String>();
itemSet.add(bomItem);
}
itemBomMap2.put(itemCodeTo, itemSet);
//////////////////////////////////////////////
//cpatil-25/08/14-System.out.println("1347---altitemMap.size()----"+altitemMap.size()+"----"+al.get(0)+"---altitemMap---"+altitemMap);
//cpatil-25/08/14-System.out.println("1374---itemBomMap.size()----"+itemBomMap.size()+"---itemBomMap---"+itemBomMap);
//al.clear();
......@@ -2916,7 +2979,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// 31, 32
+ " CASE WHEN A.MFG_TYPE IS NULL THEN 'MRP' ELSE A.MFG_TYPE END, A.ROUTE_CODE, "
// 33, 34
+ " case when a.mfg_lead_basis is null then 'F' else a.mfg_lead_basis end, case when a.batch_size_lead is null then 0 else a.batch_size_lead end,A.EMP_CODE__PLN " + " FROM SITEITEM A, ITEM B, ITEMSER C " + " WHERE A.ITEM_CODE = B.ITEM_CODE " + " AND B.ITEM_SER = C.ITEM_SER " + " AND A.SITE_CODE = ? " + " AND A.ITEM_CODE = ? ";
+ " case when a.mfg_lead_basis is null then 'F' else a.mfg_lead_basis end, case when a.batch_size_lead is null then 0 else a.batch_size_lead end,A.EMP_CODE__PLN,"
+ "CASE WHEN (CASE WHEN A.REO_LEV IS NULL THEN B.REO_LEV ELSE A.REO_LEV END) IS NULL THEN 0 ELSE " + "(CASE WHEN A.REO_LEV IS NULL THEN B.REO_LEV ELSE A.REO_LEV END) END as REO_LEV "
+ " FROM SITEITEM A, ITEM B, ITEMSER C " + " WHERE A.ITEM_CODE = B.ITEM_CODE " + " AND B.ITEM_SER = C.ITEM_SER " + " AND A.SITE_CODE = ? " + " AND A.ITEM_CODE = ? ";
// +" AND A.SITE_CODE = '" + siteCode + "' "
// +" AND A.ITEM_CODE = '" + itemCode + "' ";
......@@ -3058,6 +3123,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
batchSizeLead = rs.getDouble(34);
adpElement.setBatchSizeLead(batchSizeLead);
adpElement.setEmpCodePlan(rs.getString("EMP_CODE__PLN"));//Manoj dtd 11/03/2014
adpElement.setReorderLevel(rs.getDouble("REO_LEV"));//Manoj dtd 26/03/2015
// end 22/06/10 manoharan
rs.close();
} else
......@@ -3128,7 +3194,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// 30
+ " B.ITEM_SER, "
// 31
+ " CASE WHEN B.MFG_TYPE IS NULL THEN 'MRP' ELSE B.MFG_TYPE END,B.EMP_CODE__PLN " + " FROM ITEM B, ITEMSER C " + " WHERE B.ITEM_SER = C.ITEM_SER" + " AND B.ITEM_CODE = '" + itemCode + "' ";
+ " CASE WHEN B.MFG_TYPE IS NULL THEN 'MRP' ELSE B.MFG_TYPE END,B.EMP_CODE__PLN, "
+ "CASE WHEN B.REO_LEV IS NULL THEN 0 ELSE B.REO_LEV END as REO_LEV "
+ " FROM ITEM B, ITEMSER C " + " WHERE B.ITEM_SER = C.ITEM_SER" + " AND B.ITEM_CODE = '" + itemCode + "' ";
pstmt = conn.prepareStatement(sql);
// pstmt.setString(1,siteCode);
......@@ -3240,7 +3308,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpElement.setBatchSizeLead(0);
// end 22/06/10 manoharan
adpElement.setEmpCodePlan(rs.getString("EMP_CODE__PLN"));//Manoj dtd 11/03/2014
adpElement.setReorderLevel(rs.getDouble("REO_LEV"));//Manoj dtd 26/03/2015
rs.close();
}
......@@ -3384,8 +3452,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// normally - jiten -03/11/06
}
private String getMfgType(String itemCode, Connection conn2) throws SQLException
{
private String getMfgType(String itemCode,String siteCode, Connection conn2) throws SQLException
{ // private String getMfgType(String itemCode, Connection conn2) throws SQLException
/*
<item display="Made To Order" data="O"/>
<item display="Made To Stock" data="S"/>
......@@ -3399,7 +3467,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
ResultSet rs = null;
String descr="",sql="",mfgType="";
/*
sql = " select mfg_type from siteitem where site_code = ? and item_code = ? ";
pstmt = conn2.prepareStatement(sql);
pstmt.setString( 1, siteCode );
......@@ -3411,10 +3479,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
rs.close();rs = null;
pstmt.close();pstmt = null;
/*
if( mfgType == null || mfgType.trim().length() == 0 )
{
*/ sql = " select mfg_type from item where item_code = ? ";
sql = " select mfg_type from item where item_code = ? ";
pstmt = conn2.prepareStatement(sql);
pstmt.setString( 1, itemCode );
rs = pstmt.executeQuery();
......@@ -3424,6 +3492,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
rs.close();rs = null;
pstmt.close();pstmt = null;
*/
//}
System.out.println("@@@@@@@@cpatil-itemCode["+itemCode+"]mfgType["+mfgType+"]");
/*
......@@ -3531,7 +3600,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("@@@@@@@@@@@ after modify adpeList ----------adpeList["+adpeList+"]----");
String itemCodeAdp="",siteCodeAdp="",saleOrderAdp="" ;
double demandAdp=0,supplyAdp = 0,stockQtyAdp = 0,othSupplyAdp = 0,pendingPOAdp = 0, pendingDOAdp = 0,pendingIndentAdp = 0,pendingDRAdp = 0;
double reorderLevel=0;
for ( int ctr1 = 0; ctr1 < adpeList.size(); ctr1++ ) //Loop for each node of current detail
{
ADPElement adpElement = (ADPElement) adpeList.get(ctr1);
......@@ -3547,11 +3616,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
pendingDOAdp = adpElement.getPendingDO();
pendingIndentAdp = adpElement.getPendingIndent();
pendingDRAdp = adpElement.getPendingDR();
reorderLevel= adpElement.getReorderLevel();
System.out.println("@@@_ctr1["+ctr1+"]saleOrderAdp==["+saleOrderAdp+"]itemCodeAdp==["+itemCodeAdp+"]siteCodeAdp["+siteCodeAdp+"]demandAdp["+demandAdp+"]supplyAdp["+supplyAdp+"]stockQtyAdp["+stockQtyAdp+"]othSupplyAdp["+othSupplyAdp+"]pendingPOAdp["+pendingPOAdp+"]pendingDOAdp["+pendingDOAdp+"]pendingIndentAdp["+pendingIndentAdp+"]pendingDRAdp["+pendingDRAdp+"]");
System.out.println("@@@_ctr1["+ctr1+"]saleOrderAdp==["+saleOrderAdp+"]itemCodeAdp==["+itemCodeAdp+"]siteCodeAdp["+siteCodeAdp+"]demandAdp["+demandAdp+"]supplyAdp["+supplyAdp+"]stockQtyAdp["+stockQtyAdp+"]othSupplyAdp["+othSupplyAdp+"]pendingPOAdp["+pendingPOAdp+"]pendingDOAdp["+pendingDOAdp+"]pendingIndentAdp["+pendingIndentAdp+"]pendingDRAdp["+pendingDRAdp+"]reorderLevel["+reorderLevel+"]");
if(isDetailReq)
{
System.out.println("@@@@@010415:::itemCodeAdp["+itemCodeAdp+"]demandAdp["+demandAdp+"]-supplyAdp["+supplyAdp+"]+reorderLevel["+reorderLevel+"]");
ArrayList<HashMap<String, ADPElement>> detList=adpElement.getDetList();
for(int l=0;l<detList.size();l++)
{
......@@ -4054,6 +4126,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
double prevpendDRQty=0;
double qtStk=0;//added by Chandrashekar 0n 11-08-14
String siteCodeAdp="",tempitemCodeList="";
double reorderLevel=0,planSupply=0;
try
{
......@@ -4324,6 +4397,17 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//adpElement.setDemand(dueDate, demand, " ", " ");
//adpElement.setDemand(dueDate, demand, " ", " ");
//adpElement.setSupply(dueDate, supply);
reorderLevel=adpElement.getReorderLevel();
if(reorderLevel>0)
{
planSupply=adpElement.getDemand()-dataBeanTemp.getSupply()+reorderLevel;
////if(planSupply<=re)
adpElement.setDemand(dueDate,planSupply, adpElement.getSaleOrder(),adpElement.getLineNo());
adpElement.setReordPlanQty(planSupply);
}
adpElement.setSupply(dueDate, (Double) dataBeanTemp.getSupply());
//adpElement.setStockQty(dueDate, stockQty);
adpElement.setStockQty(dueDate, (Double) dataBeanTemp.getStockQty());
......@@ -4428,6 +4512,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
System.out.println("@@@@@@4357:itemCodeTo["+itemCodeTo+"]dueDate["+dueDate+"]bomReplaceDemand["+bomReplaceDemand+"]");
adpElement.setDemand(dueDate, bomReplaceDemand, saleOrderReplaceBom,itemCodeTo);
adpElement.setSaleOrder(saleOrderReplaceBom);
adpElement.setLineNo(lineNoReplaceBom);
adpElement.setItemCode(itemCodeTo);
}
......@@ -5034,8 +5119,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
grossWeightMap.put(rsItemCode, demand );
}
String tmpSO=checkNull(adpElement.getSaleOrder());
if(tmpSO.trim().length()==0)
{
adpeList.remove(adpeList.indexOf(adpElement));
}
}
}
/*//start Added by chandrashekar on 09-07-2014
......@@ -5340,6 +5431,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String mfgLeadBasis = "F";
double batchSizeLead = 0;
// end 22/06/10 manoharan
double reorderLevel=0;
ExplodeBom explodeBomObj = new ExplodeBom();
demand = adpElement.getDemand();
......@@ -5358,16 +5451,18 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
mfgLeadBasis = adpElement.getMfgLeadBasis();
batchSizeLead = adpElement.getBatchSizeLead();
// end 22/06/10 manoharan
reorderLevel = adpElement.getReorderLevel();
//if( isBomReplace )
//{
// demand = bomReplaceDemand;
//}
System.out.println("14012009 Optimize site : " + siteCode + " Item : " + itemCode + " Demand : " + demand + " Supply : " + supply +"bomCode["+bomCode+"]");
System.out.println("14012009 Optimize site 1 : " + siteCode + " Item : " + itemCode + " Demand : " + demand + " Supply : " + supply +"bomCode["+bomCode+"]");
try
{
if ((demand - supply) > 0)
System.out.println("@@@@@ demand["+demand+"]supply["+supply+"]reorderLevel["+reorderLevel+"]");
//if ((demand - supply) > 0 )
if ((( supply - demand ) < reorderLevel && reorderLevel>0) || ((demand - supply)>0 && reorderLevel==0) )
{
ArrayList timeMRParr = adpElement.getTimeMrpList();
System.out.println(" 3323----timeMRParr.size()---"+timeMRParr.size());
......@@ -5688,7 +5783,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// demand = bomReplaceDemand;
//}
System.out.println("14012009 Optimize site : " + siteCode + " Item : " + itemCode + " Demand : " + demand + " Supply : " + supply);
System.out.println("14012009 Optimize site 2 : " + siteCode + " Item : " + itemCode + " Demand : " + demand + " Supply : " + supply);
try
{
if ((demand - supply) > 0)
......@@ -6025,7 +6120,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//int multiplier = 1;
double multiplier = 1;
double reqQtyOriginal = reqQty;
double reorderLevel=0;//Manoj dtd 26/03/15
demand = adpElement.getDemand();
supply = adpElement.getSupply();
batchQty = adpElement.getBatchQty();
......@@ -6037,13 +6132,22 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
batchQtyType = adpElement.getBatchQtyType();
orderOpt = adpElement.getOrderOpt();
minStkDay = adpElement.getMinStkDay();
System.out.println("25022010 Item " + adpElement.getItemCode() + " integralQty " + decFormat(integralQty) + " req qty " + decFormat(reqQty) + " Batch Qty " + decFormat(batchQty));
reorderLevel=adpElement.getReorderLevel();
System.out.println("25022010 Item " + adpElement.getItemCode() + " integralQty " + decFormat(integralQty) + " req qty " + decFormat(reqQty) + " Batch Qty " + decFormat(batchQty)+"reorderLevel["+reorderLevel+"]");
if (minStkDay > 0 && mrpDynMinStk.equals("Y"))
{
stkLevel = getStkLevel(adpElement, dueDate);
} else
{
/*if(reorderLevel>0) //010415
{
stkLevel=reorderLevel;
}
else
{*/
stkLevel = adpElement.getMinQty();
//}
if (minOrderChk.equals("Y"))
{
chkOrdQty = adpElement.getMinOrderQty();
......@@ -6055,6 +6159,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
System.out.println("25022010 1-> chkOrdQty " + decFormat(chkOrdQty) + " reqQty " + decFormat(reqQty) + " stkLevel " + decFormat(stkLevel) + " reoQty " + decFormat(reoQty));
System.out.println("@@@@1 reqQty" + decFormat(reqQty) + " reorderLevel " + decFormat(reorderLevel) );
/*if (reqQty < reorderLevel && reorderLevel > 0) // added by cpatil on 30/03/15
{
reqQty = reorderLevel;
}*/
System.out.println("@@@@2 reqQty" + decFormat(reqQty) );
if (reqQty > chkOrdQty && chkOrdQty > 0)
{
if (minOrderChk.equals("Y"))
......@@ -7166,6 +7276,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
runningPlanSupply = timeMrp.getRunningPlanSupply();
independentDemand = timeMrp.getIndependentDemand();
dueDate = timeMrp.getDueDate();
System.out.println("@@@@ before MrpClubbingHorizon["+MrpClubbingHorizon+"]horizonDate["+horizonDate+"]dueDate["+dueDate+"]itemCode["+itemCode+"]");
if (MrpClubbingHorizon > 0)
{
Calendar calen = Calendar.getInstance();
......@@ -7173,11 +7284,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
calen.add(Calendar.DAY_OF_MONTH, MrpClubbingHorizon);
horizonDate = new java.sql.Timestamp(System.currentTimeMillis());
horizonDate.setTime(((java.util.Date) calen.getTime()).getTime());
System.out.println("@@@@ inside1 MrpClubbingHorizon["+MrpClubbingHorizon+"]horizonDate["+horizonDate+"]dueDate["+dueDate+"]");
} else
// 02/05/11 manoharan
{
horizonDate = dueDate;
System.out.println("@@@@ inside2 MrpClubbingHorizon["+MrpClubbingHorizon+"]horizonDate["+horizonDate+"]dueDate["+dueDate+"]");
}
System.out.println("@@@@ after MrpClubbingHorizon["+MrpClubbingHorizon+"]horizonDate["+horizonDate+"]dueDate["+dueDate+"]");
reqQty = timeMrp.getPlanSupply(); // runningDemand -
// runningSupply -
// runningPlanSupply;
......@@ -7192,6 +7306,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if (dueDate.compareTo(curDate) < 0)
{
dueDate = curDate;
horizonDate = dueDate;
}
// if (suppSour.equals("D") && disPlan.equals("Y") &&
......@@ -7491,9 +7606,56 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// ld_worder.setitem(ll_row, "ADDN_ORDER",
// trim(ls_addntranid))
System.out.println(" for addnOrder code");
ArrayList<String> addnOrderList = adpElement.getOrderList();
String refSaleOrder="";
String tempSORef="";
System.out.println(" for addnOrder code itemCode["+itemCode+"] parentItemMap 1 ["+parentItemMap+"]");
if( parentItemMap.containsKey(itemCode) )
{
String tempParentItem = parentItemMap.get(itemCode).toString();
System.out.println("@@@@@@@tempParentItem1["+tempParentItem+"]");
if( tempParentItem != null && tempParentItem.trim().length() > 0 )
{
do
{
System.out.println("@@@@@@@tempParentItem2["+tempParentItem+"]");
if( tempParentItem != null && tempParentItem.trim().length() > 0 )
{
if( soItemListMap.size() > 0 )
{
if( soItemListMap.containsKey(tempParentItem))
{
tempSORef = soItemListMap.get(tempParentItem).toString();
mpsOrder.addnOrder=tempSORef;
break;
}else
{
String tempValue = tempParentItem;
tempParentItem = parentItemMap.get(tempParentItem)== null?"":parentItemMap.get(tempParentItem).toString();
System.out.println("@@@@@tempParentItem["+tempParentItem+"]tempValue["+tempValue+"]");
if(tempValue.equalsIgnoreCase(tempParentItem) )
{
break;
}
}
}
else
{
break;
}
}
}
while ( parentItemMap.containsKey(tempParentItem) );
}
}
else
{
mpsOrder.addnOrder= soItemListMap.get(itemCode).toString();
}
System.out.println("@@@@@@@@@itemCode 2 ["+itemCode+"] tempSORef["+tempSORef+"]");
//mpsList.add(mpsOrder);
//String refSaleOrder="";
/*ArrayList<String> addnOrderList = adpElement.getOrderList();
for( int ordCnt=0; ordCnt < addnOrderList.size(); ordCnt++ )
{
String temp = addnOrderList.get(ordCnt);
......@@ -7507,9 +7669,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
System.out.println("@@@@@ refSaleOrder["+refSaleOrder+"] for addnOrder code end");
mpsOrder.addnOrder=refSaleOrder;
if( refSaleOrder == null || refSaleOrder.trim().length()==0 )
if( refSaleOrder == null || refSaleOrder.trim().length()==0 )*/
{
if( locGroupList != null )
/*if( locGroupList != null )
{
System.out.println("@@@@@ locGroupList["+locGroupList+"]");
String locGroupLst[]=locGroupList.split(",");
......@@ -7532,7 +7694,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
System.out.println("@@@@@final refSaleOrder["+refSaleOrder+"]");
mpsOrder.addnOrder=refSaleOrder;
}
}*/
}
......@@ -7562,7 +7725,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
mpsOrder.mfgType = adpElement.getMfgType();
// end 01/04/11 manoharan
mpsList.add(mpsOrder);
System.out.println("@@@@2103152:mpsOrder.quantity["+mpsOrder.quantity+"]mpsList["+mpsList.size()+"]");
}
}
// Condition to be added as per Manoharan Sir - Jiten
......@@ -7654,6 +7820,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// end 01/04/11 manoharan
mpsList.add(mpsOrder);
System.out.println("@@@@2103151:mpsOrder.quantity["+mpsOrder.quantity+"]mpsList["+mpsList.size()+"]");
}
// below block added as per Manoharan Sir - jiten
// 03/11/06 - For remaining reqQty
......@@ -7689,11 +7856,61 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
mpsOrder.mfgType = adpElement.getMfgType();
// end 01/04/11 manoharan
// start
String tempSORef="";
System.out.println(" for addnOrder code itemCode["+itemCode+"] parentItemMap 3 ["+parentItemMap+"]");
if( parentItemMap.containsKey(itemCode) )
{
String tempParentItem = parentItemMap.get(itemCode).toString();
System.out.println("@@@@@@@tempParentItem1["+tempParentItem+"]");
if( tempParentItem != null && tempParentItem.trim().length() > 0 )
{
do
{
System.out.println("@@@@@@@tempParentItem2["+tempParentItem+"]");
if( tempParentItem != null && tempParentItem.trim().length() > 0 )
{
if( soItemListMap.size() > 0 )
{
if( soItemListMap.containsKey(tempParentItem))
{
tempSORef = soItemListMap.get(tempParentItem).toString();
mpsOrder.addnOrder=tempSORef;
break;
}else
{
String tempValue = tempParentItem;
tempParentItem = parentItemMap.get(tempParentItem)== null?"":parentItemMap.get(tempParentItem).toString();
System.out.println("@@@@@tempParentItem["+tempParentItem+"]tempValue["+tempValue+"]");
if(tempValue.equalsIgnoreCase(tempParentItem) )
{
break;
}
}
}
else
{
break;
}
}
}
while ( parentItemMap.containsKey(tempParentItem) );
}
}
else
{
mpsOrder.addnOrder= soItemListMap.get(itemCode).toString();
}
System.out.println("@@@@@@@@@itemCode 3 ["+itemCode+"] tempSORef["+tempSORef+"]");
// end
mpsList.add(mpsOrder);
System.out.println("@@@@210315:mpsOrder.quantity["+mpsOrder.quantity+"]mpsList["+mpsList.size()+"]");
}
// Jiten - End 03/11/06
} else if (orderOpt.equals("C"))
{
System.out.println("@@@@210315 adpElement.getMfgType()["+adpElement.getMfgType()+"]");
int findEle = -1;
MPSOrder mpsOrder = null;
if (!"O".equals(adpElement.getMfgType())) // 01/04/11
......@@ -7704,22 +7921,29 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// not to
// club
{
System.out.println("@@@@210315 mpsList.size()["+mpsList.size()+"]");
if (mpsList.size() > 0)
{
// check for the last ones existence if
// found add the demand to that
for (int listCtr = mpsList.size() - 1; listCtr > 0; listCtr--)
for (int listCtr = mpsList.size() - 1; listCtr >= 0; listCtr--)
{
mpsOrder = (MPSOrder) mpsList.get(listCtr);
if (mpsOrder.itemCode.trim() == itemCode.trim() && mpsOrder.siteCode.trim() == siteCode.trim() && (dueDate.compareTo(horizonDate) <= 0))
System.out.println("dueDate["+dueDate+"]");
System.out.println("horizonDate["+horizonDate+"]");
System.out.println("dueDate.compareTo(horizonDate)["+dueDate.compareTo(horizonDate)+"]");
System.out.println("mpsOrder.itemCode.trim()["+mpsOrder.itemCode.trim()+"]itemCode.trim()["+itemCode.trim()+"]");
System.out.println("mpsOrder.siteCode.trim()["+mpsOrder.siteCode.trim()+"]siteCode.trim()["+siteCode.trim()+"]");
if (mpsOrder.itemCode.trim().equalsIgnoreCase(itemCode.trim()) && mpsOrder.siteCode.trim().equalsIgnoreCase(siteCode.trim()) && (dueDate.compareTo(horizonDate) <= 0))
{
findEle = listCtr;
System.out.println("@@@@@findEle1["+findEle+"]");
break;
}
}
}
}
System.out.println("@@@@@findEle2["+findEle+"]");
if (findEle >= 0)
{
mpsOrder.quantity += reqQty;
......@@ -7756,7 +7980,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// end 01/04/11 manoharan
System.out.println(" for addnOrder code");
ArrayList<String> addnOrderList = adpElement.getOrderList();
/*ArrayList<String> addnOrderList = adpElement.getOrderList();
String refSaleOrder="";
for( int ordCnt=0; ordCnt < addnOrderList.size(); ordCnt++ )
{
......@@ -7799,10 +8023,60 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
mpsOrder.addnOrder=refSaleOrder;
}
}
*/
String tempSORef="";
System.out.println(" for addnOrder code itemCode["+itemCode+"] parentItemMap 2 ["+parentItemMap+"]");
if( parentItemMap.containsKey(itemCode) )
{
String tempParentItem = parentItemMap.get(itemCode).toString();
System.out.println("@@@@@@@tempParentItem1["+tempParentItem+"]");
if( tempParentItem != null && tempParentItem.trim().length() > 0 )
{
do
{
System.out.println("@@@@@@@tempParentItem2["+tempParentItem+"]");
if( tempParentItem != null && tempParentItem.trim().length() > 0 )
{
if( soItemListMap.size() > 0 )
{
if( soItemListMap.containsKey(tempParentItem))
{
tempSORef = soItemListMap.get(tempParentItem).toString();
mpsOrder.addnOrder=tempSORef;
break;
}else
{
String tempValue = tempParentItem;
tempParentItem = parentItemMap.get(tempParentItem)== null?"":parentItemMap.get(tempParentItem).toString();
System.out.println("@@@@@tempParentItem["+tempParentItem+"]tempValue["+tempValue+"]");
if(tempValue.equalsIgnoreCase(tempParentItem) )
{
break;
}
}
}
else
{
break;
}
}
}
while ( parentItemMap.containsKey(tempParentItem) );
}
}
else
{
if( soItemListMap.containsKey(itemCode) )
{
mpsOrder.addnOrder= soItemListMap.get(itemCode) == null ?"": soItemListMap.get(itemCode).toString();
}
}
System.out.println("@@@@@@@@@itemCode 2 ["+itemCode+"] tempSORef["+tempSORef+"]");
mpsList.add(mpsOrder);
System.out.println("@@@@2103153:mpsOrder.quantity["+mpsOrder.quantity+"]mpsList["+mpsList.size()+"]");
}
}
......@@ -8154,6 +8428,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// variables added by sabyasachi ends 30-03-11
DistCommon dcommon=new DistCommon();
String lotSL="",WOtranId="";
ArrayList<Double> noArtList = new ArrayList<Double>();
ArrayList<Double> netWeightList = new ArrayList<Double>();
double noArt=0,netWeight=0;
try
{
......@@ -8219,9 +8497,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy");
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
sqlWorkOrder = "INSERT INTO WORKORDER(TRAN_ID,ORDER_TYPE,ITEM_CODE,SITE_CODE, " + "QUANTITY,ORD_DATE,PLAN_DUE_DATE,MRP_RUN_ID, " + "ADDN_ORDER,DUE_DATE,STATUS,STATUS_DATE,YIELD_PERC,ROUTE_CODE, " + "BOM_CODE,PROJ_CODE,CHG_DATE,CHG_USER,CHG_TERM,UNIT, " + "ACCT_CODE__WP,CCTR_CODE__WP,CURRENT_BATCH_QTY,UNIT__STD," + " STD_QTY,CONV__QTY_STDUOM,SALE_ORDER,LINE_NO,WORK_ORDER,LOT_SL) " + "VALUES ( ?, ? , ? , ? , ? , ? ," + " ? , ? , ? , ? , ? ," + " ? , ? , ? , ? , ? ," + " ? , ? , ? , ? , ? ," + " ? , ? , ? ,?, ?, ?,?,?,?)";
sqlWorkOrder = "INSERT INTO WORKORDER(TRAN_ID,ORDER_TYPE,ITEM_CODE,SITE_CODE, " + "QUANTITY,ORD_DATE,PLAN_DUE_DATE,MRP_RUN_ID, " + "ADDN_ORDER,DUE_DATE,STATUS,STATUS_DATE,YIELD_PERC,ROUTE_CODE, " + "BOM_CODE,PROJ_CODE,CHG_DATE,CHG_USER,CHG_TERM,UNIT, " + "ACCT_CODE__WP,CCTR_CODE__WP,CURRENT_BATCH_QTY,UNIT__STD," + " STD_QTY,CONV__QTY_STDUOM,SALE_ORDER,LINE_NO,WORK_ORDER,LOT_SL,NO_ART,NET_WEIGHT,LOC_GROUP ) " + "VALUES ( ?, ? , ? , ? , ? , ? ," + " ? , ? , ? , ? , ? ," + " ? , ? , ? , ? , ? ," + " ? , ? , ? , ? , ? ," + " ? , ? , ? ,?, ?, ?, ?, ?, ?, ?, ?, ?)";
pstmtWorkOrder = conn.prepareStatement(sqlWorkOrder);
//pstmtWorkOrder = conn.prepareStatement(sqlWorkOrder);
String sqlMpsOrder = "INSERT INTO MPS_ORDER(TRAN_ID,ORDER_TYPE,ITEM_CODE,SITE_CODE, " + "QUANTITY,ORD_DATE,PLAN_DUE_DATE,MRP_RUN_ID, " + "ADDN_ORDER,DUE_DATE,STATUS,STATUS_DATE,YIELD_PERC,ROUTE_CODE, " + "BOM_CODE,PROJ_CODE,CHG_DATE,CHG_USER,CHG_TERM,UNIT, " + "ACCT_CODE__WP,CCTR_CODE__WP,CURRENT_BATCH_QTY,UNIT__STD,STD_QTY,CONV__QTY_STDUOM,SALE_ORDER,LINE_NO) " + "VALUES ( ? , ? , ? , ? , ? ," + " ? , ? , ? , ? , ? ," + " ? , ? , ? , ? , ? ," + " ? , ? , ? , ? , ? ," + " ? , ? , ? ,?, ?, ?,?,?)";
......@@ -8321,7 +8599,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
System.out.println("@@@@@@@@@@@@@@@@@ 8196 winName["+winName+"]mfgType["+mpsOrder.mfgType+"]yieldPerc["+yieldPerc+"]");
if ("O".equals(mpsOrder.mfgType))
{
System.out.println("for workorder...itemCode["+itemCode+"].");
pstmtWorkOrder = conn.prepareStatement(sqlWorkOrder);
noArt = 0 ;
netWeight = 0 ;
System.out.println("for workorder...itemCode["+itemCode+"]addnOrder["+addnOrder+"]");
System.out.println("for workorder...["+workOrder+"]bomCode["+bomCode+"]ordType["+ordType+"]");
workOrder = getUniqueKey(xmlValues, mpsKeyStr, "work_order", "W-ORD");
pstmtWorkOrder.setString(1, workOrder);
pstmtWorkOrder.setString(2, ordType); // commented for inserting order type as M ... on 17/06/14
......@@ -8366,12 +8650,59 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
pstmtWorkOrder.setString(29, workOrder);
pstmtWorkOrder.setString(30,lotSL);
pstmtWorkOrder.addBatch();
// added by cpatil on 23/03/15 in urse --- start
noArtList = dcommon.getConvQuantityFact(unit, "NOS", itemCode, quantity, 0, conn);
if( noArtList.size() == 2 )
{
System.out.println("@@@@@noArtList["+noArtList.toString()+"]");
noArt = Double.parseDouble(noArtList.get(1)+"");
}
netWeightList = dcommon.getConvQuantityFact(unit, "KGS", itemCode, quantity, 0, conn);
if( netWeightList.size() == 2 )
{
System.out.println("@@@@@netWeightList["+netWeightList.toString()+"]");
netWeight = Double.parseDouble( netWeightList.get(1)+"");
}
pstmtWorkOrder.setDouble(31, noArt);
pstmtWorkOrder.setDouble(32, netWeight);
if( isDetailReq )
{
System.out.println("@@@@@final---locGroupMap["+locGroupMap+"]]");
String tempLocGroup="";
Set s1=locGroupMap.entrySet();
Iterator itr=s1.iterator();
while(itr.hasNext())
{
Map.Entry m=(Map.Entry)itr.next();
{
String keyListStr = m.getKey().toString();
tempLocGroup = locGroupMap.get(keyListStr).toString();
break;
}
}
pstmtWorkOrder.setString(33,tempLocGroup);
}
else
{
pstmtWorkOrder.setString(33,"");
}
// end
// pstmtWorkOrder.addBatch(); //
int rcnt = pstmtWorkOrder.executeUpdate();
System.out.println("@@@ rcnt["+rcnt+"]");
pstmtWorkOrder.close();
pstmtWorkOrder = null;
WOtranId = workOrder;
} else
{
System.out.println("for MpsOrder...itemCode["+itemCode+"].");
System.out.println("for MpsOrder...itemCode["+itemCode+"]addnOrder["+addnOrder+"]");
tranIdMpsOrder = getUniqueKey(xmlValues, mpsKeyStr, "tran_id", "W-MPS");
pstmtMpsOrder.setString(1, tranIdMpsOrder);
pstmtMpsOrder.setString(2, ordType);
......@@ -8771,10 +9102,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//cpatil-25/08/14-System.out.println("@@@@@cpatil:IPD_INDEPENDENT["+IPD_INDEPENDENT+"]");
}
int rowsInsertedWorkOrder[] = pstmtWorkOrder.executeBatch();
//int rowsInsertedWorkOrder[] = pstmtWorkOrder.executeBatch();
// Commented by Jiten 31/10/06 - error -null pointer Exception
// pstmtMpsOrder.clearParameters();
pstmtWorkOrder.close();
//pstmtWorkOrder.close();
// int [] insertToIndependentDemandCounts =
// pstmtMpsOrder.executeBatch() ;
int rowsInsertedMpsOrder[] = pstmtMpsOrder.executeBatch();
......@@ -8803,7 +9134,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// giving null pointer exception
pstmtIndDemand.close();
conn.commit();
System.out.println("Rows Inserted in Work Order : [" + rowsInsertedWorkOrder.length + "]");
// System.out.println("Rows Inserted in Work Order : [" + rowsInsertedWorkOrder.length + "]");
System.out.println("Rows Inserted in Mps Order : [" + rowsInsertedMpsOrder.length + "]");
System.out.println("Rows Inserted in Indent : [" + rowsInsertedIndent.length + "]");
System.out.println("Rows Inserted in Dist Demand : [" + rowsInsertedDistDemand.length + "]");
......@@ -9447,6 +9778,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
System.out.println("itemCodeDetailMap["+itemCodeDetailMap+"]");
System.out.println("itemBomMap["+itemBomMap+"]");
System.out.println("itemBomMap1["+itemBomMap1+"]");
System.out.println("itemBomMap2["+itemBomMap2+"]");
ArrayList<ADPElement> al=new ArrayList<ADPElement>();
/*if(isBomReplace)
{
......@@ -9750,15 +10082,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if(isDetailReq)
{
System.out.println("getRequiredDecimal(demand, 3)["+getRequiredDecimal(demand, 3)+"]");
System.out.println("getRequiredDecimal(adpElement.getReordPlanQty(), 3)["+getRequiredDecimal(adpElement.getReordPlanQty(), 3)+"]");
//valueXmlString.append("<demand protect = '1'>").append("<![CDATA[" + getRequiredDecimal(demand, 3) + "]]>").append("</demand>\r\n");//Added by manoj dtd 05/01/15
valueXmlString.append("<demand protect = '1'>").append("<![CDATA[" + getRequiredDecimal(adpElement.getDemand(), 3) + "]]>").append("</demand>\r\n");//Added by manoj dtd 05/01/15
valueXmlString.append("<demand protect = '1'>").append("<![CDATA[" + getRequiredDecimal(adpElement.getDemand()-adpElement.getReordPlanQty(), 3) + "]]>").append("</demand>\r\n");//Added by manoj dtd 05/01/15
if( adpElement.getSoDemand() == 0)
{
valueXmlString.append("<sodemand protect = '1'>").append("<![CDATA[" + getRequiredDecimal(adpElement.getDemand(), 3) + "]]>").append("</sodemand>\r\n");//Added by manoj dt
valueXmlString.append("<sodemand protect = '1'>").append("<![CDATA[" + getRequiredDecimal(adpElement.getDemand()-adpElement.getReordPlanQty(), 3) + "]]>").append("</sodemand>\r\n");//Added by manoj dt
}
else
{
valueXmlString.append("<sodemand protect = '1'>").append("<![CDATA[" + getRequiredDecimal(adpElement.getSoDemand(), 3) + "]]>").append("</sodemand>\r\n");//Added by manoj dtd 05/01/15
valueXmlString.append("<sodemand protect = '1'>").append("<![CDATA[" + getRequiredDecimal(adpElement.getSoDemand()-adpElement.getReordPlanQty(), 3) + "]]>").append("</sodemand>\r\n");//Added by manoj dtd 05/01/15
}
valueXmlString.append("<sale_order protect = '1'>").append("<![CDATA[" + adpElement.getSaleOrder() + "]]>").append("</sale_order>\r\n");
valueXmlString.append("<line_no protect = '1'>").append("<![CDATA[" + checkNull(adpElement.getLineNo()) + "]]>").append("</line_no>\r\n");
......@@ -9929,8 +10262,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
valueXmlString.append("<gross_weight protect = '1'>").append("<![CDATA["+ getRequiredDecimal(adpElement.getDemand(),3) +"]]>").append("</gross_weight>\r\n");
}
String mfgType = getMfgType( itemCode, conn);
//String mfgType = getMfgType( itemCode, conn);
String mfgType = getMfgType( itemCode,siteCode, conn);
valueXmlString.append("<mfg_type protect = '1'>").append("<![CDATA["+mfgType +"]]>").append("</mfg_type>\r\n");
valueXmlString.append("<itemType protect = '1'>").append("<![CDATA[" + getItemType(suppSour) + "]]>").append("</itemType>\r\n");
......@@ -11466,7 +11799,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
}
// Added by Jiten 07/11/06
//Added by Jiten 07/11/06
class CyclicItem
{
public String siteCode;
......
......@@ -119,7 +119,7 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
int cnt;
//int cnt;
System.out.println("childNodeName 0. : " + childNodeName);
if (childNodeName.equals("date_to"))
{
......@@ -149,6 +149,7 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
}
if (childNodeName.equals("site_code__to"))
{
if (childNode.getFirstChild() == null || genericUtility.getColumnValue("site_code__from",dom) == null)
{
errCode = "VMRPSITE1";
......@@ -165,6 +166,100 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
break;
}
count = 0;
//for validate site for perticular user added on 20/03/15 urse start@@@@@@@@@
String loginId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
if (siteCodeFrom != null && siteCodeFrom.trim().length() > 0)
{
sql = "SELECT COUNT(*) COUNT FROM SITE WHERE SITE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeFrom);
rs = pstmt.executeQuery();
if (rs.next())
{
count = rs.getInt("COUNT");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (count == 0)
{
errCode = "VMSITEFR";
errString = getErrorString(childNodeName, errCode, userId);
break;
}
count = 0;
sql = "SELECT COUNT(*) COUNT FROM USER_SITE WHERE USER_ID = ? AND SITE_CODE= ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginId);
pstmt.setString(2, siteCodeFrom);
rs = pstmt.executeQuery();
if (rs.next())
{
count = rs.getInt("COUNT");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (count == 0)
{
errCode = "INVUSRSITE";
errString = getErrorString(childNodeName, errCode, userId);
break;
}
}
if (siteCodeTo != null && siteCodeTo.trim().length() > 0)
{
sql = "SELECT COUNT(*) COUNT FROM SITE WHERE SITE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeTo);
rs = pstmt.executeQuery();
if (rs.next())
{
count = rs.getInt("COUNT");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (count == 0)
{
errCode = "VMSITETO";
errString = getErrorString(childNodeName, errCode, userId);
break;
}
count=0;
sql = "SELECT COUNT(*) COUNT FROM USER_SITE WHERE USER_ID = ? AND SITE_CODE= ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginId);
pstmt.setString(2, siteCodeTo);
rs = pstmt.executeQuery();
if (rs.next())
{
count = rs.getInt("COUNT");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (count == 0)
{
errCode = "INVUSRSITE";
errString = getErrorString(childNodeName, errCode, userId);
break;
}
}
// end
}
......@@ -234,7 +329,7 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
String childNodeName = null;
String sql = "";
String siteCodeTo = "" , siteCodeFr = "" ,saleOrder = "" ,itemCode = "" , siteCode = "" ;
String mrpGetData = "", itemCodeList = "" , winName = "", saleOrderList="";
String mrpGetData = "", itemCodeList = "" , winName = "", saleOrderList="", soItemList = "";
StringBuffer valueXmlString = new StringBuffer();
int ctr = 0 , currentFormNo = 0 ,lineNo = 0 ,domID = 0;
java.sql.Timestamp dateTo = null ,dateFr = null;
......@@ -420,7 +515,7 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
sql=" select a.sale_order,a.line_no,a.site_code,a.item_code,a.due_date,a.cust_code,a.cust_name," +
"a.quantity,a.unit,a.type,a.order_due_date , a.order_date ,a.mfg_type " +
" a.quantity,a.unit,a.type,a.order_due_date , a.order_date ,a.mfg_type " +
" from ( " +
" SELECT sorditem.sale_order as sale_order,sorditem.line_no as line_no," +
" sorditem.site_code as site_code," +
......@@ -441,7 +536,8 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
//" and (sorditem.due_date >= ? ) and (sorditem.due_date <= ? )" +
" and ( case when sorder.status is null then 'P' else sorder.status end = 'P')" +
" and (sorder.cust_code = customer.cust_code )" +
" and case when sorder.alloc_flag is null then 'N' else sorder.alloc_flag end <> 'Y' " +
//" and case when sorder.alloc_flag is null then 'N' else sorder.alloc_flag end <> 'Y' " +
" and case when sorditem.alloc_flag is null then 'N' else sorditem.alloc_flag end <> 'Y' " +
" and ( siteitem.item_code = item.item_code ) and ( siteitem.site_code = sorditem.site_code ) " ;
if("order_date".equalsIgnoreCase(viewByDate))
......@@ -484,7 +580,7 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
sql = sql+" and ( (mps_order.ord_date >= ? and mps_order.ord_date <= ? ) or (mps_order.due_date >= ? and mps_order.due_date <= ? ) ) ";
}
sql = sql + " ) a ";
sql = sql + " ) a where a.quantity > 0 ";
if("order_date".equalsIgnoreCase(viewByDate))
{
......@@ -616,7 +712,7 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
//locGroupList = locGroupList + ",'"+saleOrder+itemCode+"@"+locGroup+"'" ;
locGroupList = locGroupList + ","+checkNull(saleOrder).trim()+"@"+checkNull(locGroup).trim()+"" ;
soItemList = soItemList + ","+saleOrder+"@"+itemCode+"" ;
}
else
{
......@@ -625,12 +721,12 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
//locGroupList = "'"+saleOrder+itemCode+"@"+locGroup+"'" ;
locGroupList = ""+checkNull(saleOrder).trim()+"@"+checkNull(locGroup).trim()+"" ;
soItemList = saleOrder+"@"+itemCode ;
}
System.out.println("itemCodeList=="+itemCodeList);
System.out.println("itemCodeOnlyList=="+itemCodeOnlyList);
System.out.println("locGroupList=="+locGroupList);
System.out.println("soItemList=="+soItemList);
orderType= checkNull(genericUtility.getColumnValueFromNode( "order_type", detail2List.item(ctr1) ));
System.out.println("inside for orderType["+orderType+"]");
......@@ -690,6 +786,7 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
System.out.println("@@@@@@@@:: order_type["+orderType+"]");
// xmlString.append("<site_code>").append("<![CDATA[").append(siteCode).append("]]>").append("</site_code>");
argData.append("<locGroupList>").append("<![CDATA[").append(locGroupList).append("]]>").append("</locGroupList>\r\n");
argData.append("<soItemList>").append("<![CDATA[").append(soItemList).append("]]>").append("</soItemList>\r\n");
argData.append("</Detail>");
argData.append("</Root>");
......
......@@ -352,6 +352,7 @@ public class WorderCampaign extends ProcessEJB implements WorderCampaignLocal, W
String wostatus="",workorder="",chgTerm="",chgUser="",utranid="";
GenericUtility genutility = null;
HashMap<String, String> comMap=new HashMap<String, String>();
String campItemWise="";
try {
connDriver = new ConnDriver();
......@@ -361,6 +362,21 @@ public class WorderCampaign extends ProcessEJB implements WorderCampaignLocal, W
itmDBAccessEJB = new ITMDBAccessEJB();
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
// added by cpatil on 23/03/15 in urse for supreme start
sql = " SELECT VAR_VALUE FROM MFGPARM WHERE PRD_CODE ='999999' AND VAR_NAME ='CAMP_ITEM_WISE' ";
pstmt=conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
campItemWise = rs.getString(1) == null ? "":rs.getString(1);
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
System.out.println("@@@@@@ campItemWise["+campItemWise+"]");
//added by cpatil on 23/03/15 in urse for supreme end
parentNodeList = detailDom.getElementsByTagName("Detail2");
for (int i = 0; i < parentNodeList.getLength(); i++) {
parentNode = parentNodeList.item(i);
......@@ -414,10 +430,19 @@ public class WorderCampaign extends ProcessEJB implements WorderCampaignLocal, W
rs.close();
pstmt = null;
rs = null;
if(campItemWise != null && "N".equalsIgnoreCase(campItemWise)) // added condition for supreme MFGPARM 'CAMP_ITEM_WISE' define as 'N' value
{
if(utranid.trim().length() <= 0)
{
utranid = generateTranId("w_wocampaign", loginSite, conn);
}
}
else if("Y".equalsIgnoreCase(campItemWise) || campItemWise == null || "".equalsIgnoreCase(campItemWise) || campItemWise.trim().length() == 0 )
{
if(comMap.containsKey(woItemCode))
{
utranid= comMap.get(woItemCode);
}
else
{ utranid = generateTranId("w_wocampaign", loginSite, conn);
......@@ -425,6 +450,7 @@ public class WorderCampaign extends ProcessEJB implements WorderCampaignLocal, W
comMap.put(woItemCode, utranid);
System.out.println("comMap[["+comMap+"]]");
}
}
//end by chandrashekar on on 09-oct-14
/*if(utranid.trim().length() <= 0)
......
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