Commit c588778e authored by caluka's avatar caluka

Removing exponential values for Material Requirement wizard Transaction[MF3KSUN005]


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@34147 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 688c0017
...@@ -3036,7 +3036,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -3036,7 +3036,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
ADPElement adpElement = (ADPElement) adpeList.get(ctr); ADPElement adpElement = (ADPElement) adpeList.get(ctr);
adpElement = populateDemandSupply(adpElement); adpElement = populateDemandSupply(adpElement);
adpeList.set(ctr, adpElement); adpeList.set(ctr, adpElement);
System.out.println("Quarantine stock["+adpElement.getQtStk()+"]");
System.out.println("SaleSales order set in ADPElement---"+adpElement.getSiteCode()+"---"+adpElement.getItemCode()+"---"+adpElement.getSaleOrder()+"----"+adpElement.getLineNo()); System.out.println("SaleSales order set in ADPElement---"+adpElement.getSiteCode()+"---"+adpElement.getItemCode()+"---"+adpElement.getSaleOrder()+"----"+adpElement.getLineNo());
if(isDetailReq) if(isDetailReq)
{ {
...@@ -3113,6 +3113,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -3113,6 +3113,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
double prevpendDOQty=0; double prevpendDOQty=0;
double prevpendIndQty=0; double prevpendIndQty=0;
double prevpendDRQty=0; double prevpendDRQty=0;
double qtStk=0;//added by Chandrashekar 0n 11-08-14
try try
{ {
...@@ -3265,6 +3266,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -3265,6 +3266,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
pendIndQty = rs.getDouble(9); pendIndQty = rs.getDouble(9);
pendPOQty = rs.getDouble(7); pendPOQty = rs.getDouble(7);
if(isRequirement)
{
qtStk = rs.getDouble(12);
}
System.out.println("isDetailReq3------"+isDetailReq); System.out.println("isDetailReq3------"+isDetailReq);
if(isDetailReq) if(isDetailReq)
{ {
...@@ -3307,6 +3312,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -3307,6 +3312,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpElement.setPendingDO(dueDate, pendDOQty); adpElement.setPendingDO(dueDate, pendDOQty);
adpElement.setPendingIndent(dueDate, pendIndQty); adpElement.setPendingIndent(dueDate, pendIndQty);
adpElement.setPendingDR(dueDate, pendDRQty); adpElement.setPendingDR(dueDate, pendDRQty);
if(isRequirement)
{
adpElement.setQtStk(qtStk);
}
if(isDetailReq) if(isDetailReq)
{ {
/* /*
...@@ -3585,7 +3594,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -3585,7 +3594,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
pendIndQty = rs.getDouble(11); pendIndQty = rs.getDouble(11);
pendDRQty = rs.getDouble(12); pendDRQty = rs.getDouble(12);
// End Changes by Gulzar on 4/18/2012 // End Changes by Gulzar on 4/18/2012
if(isRequirement)
{
siteCode = rs.getString(13);//Added by Chandrashekar on 09-07-2014 siteCode = rs.getString(13);//Added by Chandrashekar on 09-07-2014
}
// cpatil start // cpatil start
System.out.println("@@@@@saleOrder["+saleOrder+"]["+adpElement.getSaleOrder()+"]lineNo["+lineNo+"]["+adpElement.getLineNo()+"]@@@@@@@@@@@"); System.out.println("@@@@@saleOrder["+saleOrder+"]["+adpElement.getSaleOrder()+"]lineNo["+lineNo+"]["+adpElement.getLineNo()+"]@@@@@@@@@@@");
System.out.println("@@@@@@@@@@@sorderList["+sorderList+"]@@@@@@@@@itemCodeList["+itemCodeList+"]"); System.out.println("@@@@@@@@@@@sorderList["+sorderList+"]@@@@@@@@@itemCodeList["+itemCodeList+"]");
...@@ -7204,7 +7216,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -7204,7 +7216,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String resultString = ""; String resultString = "";
StringBuffer retTabSepStrBuff = new StringBuffer(); StringBuffer retTabSepStrBuff = new StringBuffer();
StringBuffer valueXmlString = new StringBuffer(); StringBuffer valueXmlString = new StringBuffer();
StringBuffer reqValueXmlString = new StringBuffer();
String siteCode = "0"; String siteCode = "0";
String itemCode = "0"; String itemCode = "0";
String bomCode = "0"; String bomCode = "0";
...@@ -7246,6 +7258,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -7246,6 +7258,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
double pendDOQty = 0; double pendDOQty = 0;
double pendIndQty = 0; double pendIndQty = 0;
double pendDRQty = 0; double pendDRQty = 0;
double qtStk = 0;
// End changes by gulzar on 4/18/2012 // End changes by gulzar on 4/18/2012
int count1=0,count2=0; int count1=0,count2=0;
ADPElement adpElement = null; ADPElement adpElement = null;
...@@ -7265,8 +7278,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -7265,8 +7278,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
try try
{ {
valueXmlString = new StringBuffer("<?xml version = \"1.0\"?><Root>\r\n"); valueXmlString = new StringBuffer("<?xml version = \"1.0\"?><Root>\r\n");
int count = 0; int count = 0,reqCount = 0;
reqValueXmlString = new StringBuffer("<?xml version = \"1.0\"?><Root>\r\n");//added by chandrashekar 0n 12-08-14
Set sorderItemSet=new TreeSet(); Set sorderItemSet=new TreeSet();
...@@ -7444,7 +7458,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -7444,7 +7458,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
lineNo=adpElement.getLineNo(); lineNo=adpElement.getLineNo();
itemCodeParent = adpElement.getItemCodeParent(); //added by cpatil on 03/05/14 itemCodeParent = adpElement.getItemCodeParent(); //added by cpatil on 03/05/14
originalOrAltitem = adpElement.getOriginalOrAltitem(); //added by cpatil on 03/05/14 originalOrAltitem = adpElement.getOriginalOrAltitem(); //added by cpatil on 03/05/14
qtStk = adpElement.getQtStk(); //added by chandrashekar 0n 12-08-14
System.out.println("qtStk["+qtStk+"]");
itemCDDetailMap = adpElement.getbomSet(); itemCDDetailMap = adpElement.getbomSet();
System.out.println("@@@@@@@@itemCDDetailMap["+itemCDDetailMap+"]"); System.out.println("@@@@@@@@itemCDDetailMap["+itemCDDetailMap+"]");
...@@ -7470,6 +7485,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -7470,6 +7485,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
System.out.println("14/06/14 supreme Detail4List for itemCode [" + itemCode + "] detList.size() [" + detList.size() + "] detList [" + detList.toString() + "]"); System.out.println("14/06/14 supreme Detail4List for itemCode [" + itemCode + "] detList.size() [" + detList.size() + "] detList [" + detList.toString() + "]");
} }
double demandSum = 0,pendPOQtySum = 0;
double supplySum = 0,pendIndQtySum = 0;
double planSupplySum = 0,independentDemandSum = 0;
double runningDemandSum = 0,runningPlanSupplySum = 0;
double runningSupplySum = 0,planSupplySumSum = 0;
for (int timeCtr = 0; timeCtr < timeMRParr.size(); timeCtr++) for (int timeCtr = 0; timeCtr < timeMRParr.size(); timeCtr++)
{ {
...@@ -7478,12 +7498,21 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -7478,12 +7498,21 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
System.out.println("Printing timeMrp---" + timeMrp); System.out.println("Printing timeMrp---" + timeMrp);
demand = timeMrp.getDemand(); demand = timeMrp.getDemand();
demandSum = demandSum+demand;
System.out.println("demand["+demand+"]");
System.out.println("demandSum["+demandSum+"]");
supply = timeMrp.getSupply(); supply = timeMrp.getSupply();
supplySum = supplySum+supply;
planSupply = timeMrp.getPlanSupply(); planSupply = timeMrp.getPlanSupply();
planSupplySum = planSupplySum+planSupply;
runningDemand = timeMrp.getRunningDemand(); runningDemand = timeMrp.getRunningDemand();
runningDemandSum = runningDemandSum+runningDemand;
runningSupply = timeMrp.getRunningSupply(); runningSupply = timeMrp.getRunningSupply();
runningSupplySum = runningSupplySum+runningSupply;
runningPlanSupply = timeMrp.getRunningPlanSupply(); runningPlanSupply = timeMrp.getRunningPlanSupply();
runningPlanSupplySum = runningPlanSupplySum+runningPlanSupply;
independentDemand = timeMrp.getIndependentDemand(); independentDemand = timeMrp.getIndependentDemand();
independentDemandSum = independentDemandSum+independentDemand;
dueDateStr = simpleDateFormat.format(timeMrp.getDueDate()); dueDateStr = simpleDateFormat.format(timeMrp.getDueDate());
// 12/04/10 manoharan MF90BHU001 // 12/04/10 manoharan MF90BHU001
stockQty = timeMrp.getStockQty(); stockQty = timeMrp.getStockQty();
...@@ -7492,8 +7521,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -7492,8 +7521,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// Changes made by Gulzar on 4/18/2012 // Changes made by Gulzar on 4/18/2012
pendPOQty = timeMrp.getPendingPO(); pendPOQty = timeMrp.getPendingPO();
pendPOQtySum = pendPOQtySum+pendPOQty;
pendDOQty = timeMrp.getPendingDO(); pendDOQty = timeMrp.getPendingDO();
pendIndQty = timeMrp.getPendingIndent(); pendIndQty = timeMrp.getPendingIndent();
pendIndQtySum = pendIndQtySum+pendIndQty;
pendDRQty = timeMrp.getPendingDR(); pendDRQty = timeMrp.getPendingDR();
// End changes by Gulzar on 4/18/2012 // End changes by Gulzar on 4/18/2012
...@@ -8172,13 +8203,64 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -8172,13 +8203,64 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
valueXmlString.append("</Detail" + context + ">"); valueXmlString.append("</Detail" + context + ">");
} }
if(isRequirement)//Added by Chandrashekar on 11-08-14
{
valueXmlString = new StringBuffer();
System.out.println("context["+context+"]");
//reqValueXmlString = new StringBuffer("<?xml version = \"1.0\"?><Root>\r\n");
reqCount++;
reqValueXmlString.append("<Detail" + context + " domID='" + reqCount + "' >\r\n");
reqValueXmlString.append("<site_code protect = '1'>").append("<![CDATA[" + siteCode + "]]>").append("</site_code>\r\n");
reqValueXmlString.append("<item_code protect = '1'>").append("<![CDATA[" + itemCode + "]]>").append("</item_code>\r\n");
reqValueXmlString.append("<supp_sour protect = '1'>").append("<![CDATA[" + suppSour + "]]>").append("</supp_sour>\r\n");
reqValueXmlString.append("<demand protect = '1'>").append("<![CDATA[" + getRequiredDecimal(demandSum, 3) + "]]>").append("</demand>\r\n");
reqValueXmlString.append("<supply protect = '1'>").append("<![CDATA[" + round(supplySum, 3) + "]]>").append("</supply>\r\n");
reqValueXmlString.append("<due_date protect = '1'>").append("<![CDATA[" + dueDateStr + "]]>").append("</due_date>\r\n");
reqValueXmlString.append("<plan_supply protect = '1'>").append("<![CDATA[" + getRequiredDecimal(planSupplySum, 3) + "]]>").append("</plan_supply>\r\n");
reqValueXmlString.append("<running_demand protect = '1'>").append("<![CDATA[" + getRequiredDecimal(runningDemandSum, 3) + "]]>").append("</running_demand>\r\n");
reqValueXmlString.append("<running_supply protect = '1'>").append("<![CDATA[" + getRequiredDecimal(runningSupplySum, 3) + "]]>").append("</running_supply>\r\n");
reqValueXmlString.append("<running_plan_supply protect = '1'>").append("<![CDATA[" + getRequiredDecimal(runningPlanSupplySum, 3) + "]]>").append("</running_plan_supply>\r\n");
reqValueXmlString.append("<independent_demand protect = '1'>").append("<![CDATA[" + getRequiredDecimal(independentDemand, 3) + "]]>").append("</independent_demand>\r\n");
if (bomCode != null)
{
reqValueXmlString.append("<bom_code protect = '1'>").append("<![CDATA[" + bomCode + "]]>").append("</bom_code>\r\n");
} else
{
reqValueXmlString.append("<bom_code protect = '1'>").append("<![CDATA[" + "" + "]]>").append("</bom_code>\r\n");
}
reqValueXmlString.append("<order_opt protect = '1'>").append("<![CDATA[" + orderOpt + "]]>").append("</order_opt>\r\n");
reqValueXmlString.append("<batch_qty_type protect = '1'>").append("<![CDATA[" + batchQtyType + "]]>").append("</batch_qty_type>\r\n");
reqValueXmlString.append("<unit protect = '1'>").append("<![CDATA[" + unit + "]]>").append("</unit>\r\n");
reqValueXmlString.append("<min_order_qty protect = '1'>").append("<![CDATA[" + getRequiredDecimal(minOrderQty, 3) + "]]>").append("</min_order_qty>\r\n");
reqValueXmlString.append("<integral_qty protect = '1'>").append("<![CDATA[" + getRequiredDecimal(integralQty, 3) + "]]>").append("</integral_qty>\r\n");
reqValueXmlString.append("<max_qty protect = '1'>").append("<![CDATA[" + getRequiredDecimal(maxQty, 3) + "]]>").append("</max_qty>\r\n");
reqValueXmlString.append("<min_qty protect = '1'>").append("<![CDATA[" + getRequiredDecimal(minQty, 3) + "]]>").append("</min_qty>\r\n");
reqValueXmlString.append("<reorder_qty protect = '1'>").append("<![CDATA[" + getRequiredDecimal(reorderQty, 3) + "]]>").append("</reorder_qty>\r\n");
reqValueXmlString.append("<yield_perc protect = '1'>").append("<![CDATA[" + getRequiredDecimal(yieldPerc, 2) + "]]>").append("</yield_perc>\r\n");
reqValueXmlString.append("<min_plan_perc protect = '1'>").append("<![CDATA[" + getRequiredDecimal(minPlanPerc, 2) + "]]>").append("</min_plan_perc>\r\n");
reqValueXmlString.append("<batch_qty protect = '1'>").append("<![CDATA[" + getRequiredDecimal(batchQty, 3) + "]]>").append("</batch_qty>\r\n");
reqValueXmlString.append("<purc_rate protect = '1'>").append("<![CDATA[" + getRequiredDecimal(purcRate, 3) + "]]>").append("</purc_rate>\r\n");
reqValueXmlString.append("<pur_lead_time protect = '1'>").append("<![CDATA[" + getRequiredDecimal(purLeadTime, 3) + "]]>").append("</pur_lead_time>\r\n");
reqValueXmlString.append("<qc_lead_time protect = '1'>").append("<![CDATA[" + getRequiredDecimal(qcLeadTime, 3) + "]]>").append("</qc_lead_time>\r\n");
reqValueXmlString.append("<mfg_lead_time protect = '1'>").append("<![CDATA[" + getRequiredDecimal(mfgLeadTime, 3) + "]]>").append("</mfg_lead_time>\r\n");
reqValueXmlString.append("<description protect = '1'>").append("<![CDATA[" + desc + "]]>").append("</description>\r\n");
reqValueXmlString.append("<stock_qty protect = '1'>").append("<![CDATA[" + getRequiredDecimal(stockQty, 3) + "]]>").append("</stock_qty>\r\n");
reqValueXmlString.append("<oth_supply protect = '1'>").append("<![CDATA[" + getRequiredDecimal(othSupply, 3) + "]]>").append("</oth_supply>\r\n");
reqValueXmlString.append("<pending_po protect = '1'>").append("<![CDATA[" + getRequiredDecimal(pendPOQtySum, 3) + "]]>").append("</pending_po>\r\n");
reqValueXmlString.append("<pending_do protect = '1'>").append("<![CDATA[" + getRequiredDecimal(pendDOQty, 3) + "]]>").append("</pending_do>\r\n");
reqValueXmlString.append("<pending_indent protect = '1'>").append("<![CDATA[" + getRequiredDecimal(pendIndQtySum, 3) + "]]>").append("</pending_indent>\r\n");
reqValueXmlString.append("<pending_dr protect = '1'>").append("<![CDATA[" + getRequiredDecimal(pendDRQty, 3) + "]]>").append("</pending_dr>\r\n");
reqValueXmlString.append("<quarntine_stk protect = '1'>").append("<![CDATA[" + getRequiredDecimal(qtStk, 3) + "]]>").append("</quarntine_stk>\r\n");
reqValueXmlString.append("</Detail" + context + ">");
} }
}
valueXmlString.append("</Root>"); valueXmlString.append("</Root>");
reqValueXmlString.append("</Root>");
System.out.println("Printing reqValueXmlString----" + reqValueXmlString);
System.out.println("Printing valueXmlString----2---" + valueXmlString); System.out.println("Printing valueXmlString----2---" + valueXmlString);
System.out.println("Printing context-------" + context); System.out.println("Printing context-------" + context);
// context=2; // context=2;
...@@ -8192,6 +8274,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -8192,6 +8274,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
resultString = retTabSepStrBuff.toString(); resultString = retTabSepStrBuff.toString();
} }
if(isRequirement)//Added by Chandrashekar on 11-08-14
{
resultString = reqValueXmlString.toString();
}
System.out.println("resultString---" + resultString); System.out.println("resultString---" + resultString);
// resultString = valueXmlString.toString(); // resultString = valueXmlString.toString();
// System.out.println("End of collected datas......"); // System.out.println("End of collected datas......");
...@@ -8214,6 +8300,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -8214,6 +8300,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
conn = null; conn = null;
retTabSepStrBuff = null; retTabSepStrBuff = null;
valueXmlString = null; valueXmlString = null;
reqValueXmlString = null;
} catch (Exception e) } catch (Exception e)
{ {
} }
...@@ -8258,7 +8345,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -8258,7 +8345,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
return descr; return descr;
} }
public double getRequiredDecimal(double actVal, int prec) /*public double getRequiredDecimal(double actVal, int prec)
{ {
NumberFormat numberFormat = NumberFormat.getIntegerInstance(); NumberFormat numberFormat = NumberFormat.getIntegerInstance();
Double DoubleValue = new Double(actVal); Double DoubleValue = new Double(actVal);
...@@ -8267,9 +8354,20 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -8267,9 +8354,20 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
strValue = strValue.replaceAll(",", ""); strValue = strValue.replaceAll(",", "");
double reqVal = Double.parseDouble(strValue); double reqVal = Double.parseDouble(strValue);
return reqVal; return reqVal;
}*/
public String getRequiredDecimal(double actVal, int prec)//Added by chandrashekar on 11-08-14
{
String fmtStr = "############0";
String strValue = null;
if (prec > 0)
{
fmtStr = fmtStr + "." + "000000000".substring(0, prec);
}
DecimalFormat decFormat = new DecimalFormat(fmtStr);
return decFormat.format(actVal);
} }
// *
private void Write2XSL() throws ITMException private void Write2XSL() throws ITMException
{ {
String errCode = "", date; String errCode = "", 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