Commit 4fcf9f62 authored by prane's avatar prane

changes done to check where dueDate is less than stockDate

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@179209 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8191d6f6
......@@ -280,6 +280,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//End added by Pavan R on 22/NOV/17
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
String Stksql = null;
PreparedStatement stkpstmt = null;
ResultSet stkrs = null;
Timestamp stockDate = null;
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException, ITMException
{
System.out.println("Called process(string, string).....xtraParams["+xtraParams+"]");
......@@ -1701,6 +1709,22 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
}
}
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
System.out.println("dateFrom:["+dateFrom+"]");
Stksql = "select FN_MRP_DUEDATE(?) from dual";
stkpstmt = conn.prepareStatement(Stksql);
stkpstmt.setTimestamp(1,dateFrom);
stkrs = stkpstmt.executeQuery();
if(stkrs.next())
{
stockDate = stkrs.getTimestamp(1);
}
System.out.println("stockDate:["+stockDate+"]");
stkrs.close();
stkrs=null;
stkpstmt.close();
stkpstmt=null;
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
//code added by sagar on 01/06/15, End.
} catch (Exception e)
{
......@@ -4898,6 +4922,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if(!isDetailReq)
{
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
if(dueDate.before(stockDate))
{
//throw new Exception();
throw new ITMException(new Exception("dueDate is less than stockDate["+dueDate+"]"));
}
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
adpElement.setDemand(dueDate, demand, " ", " ");
}
adpElement.setSupply(dueDate, supply);
......@@ -4990,6 +5021,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{// if condition added by jiten as per Manoharan Sir
// 10/11/06
ADPElement tempADPElement = (ADPElement) adpeList.get(ctr);
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
if(dueDate.before(stockDate))
{
//throw new Exception();
throw new ITMException(new Exception("dueDate is less than stockDate["+dueDate+"]"));
}
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
tempADPElement.setDemand(dueDate, demand, " ", " ");
tempADPElement.setSupply(dueDate, supply);
adpeList.set(ctr, tempADPElement);
......@@ -5741,6 +5779,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("BASE@@@@@4810 adpElement.getDemand()["+adpElement.getDemand()+"]");
if(! (adpElement.getDemand() > 0)) //031016
{
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
if(dueDate.before(stockDate))
{
//throw new Exception();
throw new ITMException(new Exception("dueDate is less than stockDate["+dueDate+"]"));
}
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
adpElement.setDemand(dueDate, bomReplaceDemand, saleOrderReplaceBom,itemCodeTo);
}
//System.out.println("BASE@@@@@4812 adpElement.getDemand()["+adpElement.getDemand()+"]");
......@@ -6098,6 +6143,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
ADPElement tempADPElement = (ADPElement) adpeList.get(ctr);
//System.out.println("BASE3155---saleOrder---"+saleOrder+"---lineNo---"+lineNo);
//System.out.println("BASE@@@@@5142 tempADPElement.getDemand()["+tempADPElement.getDemand()+"]");
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
if(dueDate.before(stockDate))
{
//throw new Exception();
throw new ITMException(new Exception("dueDate is less than stockDate["+dueDate+"]"));
}
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
tempADPElement.setDemand(dueDate, demand, saleOrder, lineNo); // comment on 12/01/15
//System.out.println("BASE@@@@@5144 tempADPElement.getDemand()["+tempADPElement.getDemand()+"]");
/*
......@@ -6120,6 +6172,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
newADPElement.setSaleOrder(saleOrder);
newADPElement.setLineNo(lineNo);
//System.out.println("BASE@@@@@5162 newADPElement.getDemand()["+newADPElement.getDemand()+"]");
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
if(dueDate.before(stockDate))
{
//throw new Exception();
throw new ITMException(new Exception("dueDate is less than stockDate["+dueDate+"]"));
}
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
newADPElement.setDemand(dueDate, demand, saleOrder, lineNo);
//System.out.println("BASE@@@@@5164 newADPElement.getDemand()["+newADPElement.getDemand()+"]");
/*
......@@ -7184,6 +7243,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpElement = (ADPElement) adpeList.get(adpeCtr);
if (adpElement.getItemCode().trim().equals(itemCode.trim()) && adpElement.getSiteCode().trim().equals(siteCode.trim()))
{
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
if(dueDate.before(stockDate))
{
//throw new Exception();
throw new ITMException(new Exception("dueDate is less than stockDate["+dueDate+"]"));
}
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
adpElement.setDemand(dueDate, quantity, " ", " ");
found = adpeCtr;
adpeList.set(adpeCtr, adpElement);
......@@ -7196,6 +7262,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpElement.setItemCode(itemCode);
adpElement.setSiteCode(siteCode);
adpElement = setAdpeValues(adpElement);
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
if(dueDate.before(stockDate))
{
//throw new Exception();
throw new ITMException(new Exception("dueDate is less than stockDate["+dueDate+"]"));
}
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
adpElement.setDemand(dueDate, quantity, " ", " ");
adpeList.add(adpElement);
}
......@@ -7804,11 +7877,25 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if(isBomReplace)
{
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
if(dueDate.before(stockDate))
{
//throw new Exception();
throw new ITMException(new Exception("dueDate is less than stockDate["+dueDate+"]"));
}
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
adpElement.setDemand(dueDate, quantity, " ", " ");
//adpElement.setDemand(dueDate, quantity, saleOrder, itemCode);
}
else
{
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
if(dueDate.before(stockDate))
{
//throw new Exception();
throw new ITMException(new Exception("dueDate is less than stockDate["+dueDate+"]"));
}
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
adpElement.setDemand(dueDate, quantity, saleOrder, itemCode);
}
//System.out.println("BASE6459--adpElement.getTimeMrpList().size()"+adpElement.getTimeMrpList().size());
......@@ -7841,6 +7928,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
System.out.println("12/06/14 setting demand 2 itemCode [" + itemCode + "] dueDate [" + dueDate + "] quantity [" + quantity + "] saleOrder [" + saleOrder + "] lineNo [" + lineNo +"]");
}
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
if(dueDate.before(stockDate))
{
//throw new Exception();
throw new ITMException(new Exception("dueDate is less than stockDate["+dueDate+"]"));
}
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
adpElement.setDemand(dueDate, quantity, saleOrder, lineNo);
adpeList.set(index, adpElement);
......@@ -7862,10 +7956,24 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
newADPElement.setLineNo(lineNo);
if(isBomReplace)
{
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
if(dueDate.before(stockDate))
{
//throw new Exception();
throw new ITMException(new Exception("dueDate is less than stockDate["+dueDate+"]"));
}
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
adpElement.setDemand(dueDate, quantity, " ", " ");
}
else
{
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
if(dueDate.before(stockDate))
{
//throw new Exception();
throw new ITMException(new Exception("dueDate is less than stockDate["+dueDate+"]"));
}
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
newADPElement.setDemand(dueDate, quantity, saleOrder, lineNo);
}
adpeList.add(newADPElement);
......
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