Commit 5761dd4a authored by cpatil's avatar cpatil

modified @urse


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99121 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2706a4d5
...@@ -210,7 +210,7 @@ public class MRPWizardAllocateQtyBean ...@@ -210,7 +210,7 @@ public class MRPWizardAllocateQtyBean
{ {
Node detail4Node = detail4List.item(cntr); Node detail4Node = detail4List.item(cntr);
//NodeList detail4NodeList = detail4Node.getChildNodes(); //NodeList detail4NodeList = detail4Node.getChildNodes();
System.out.println("@@@@@@@@@node name[" + detail4Node.getNodeName()+"]"); //System.out.println("@@@@@@@@@node name[" + detail4Node.getNodeName()+"]");
// if( detail4Node != null && detail4Node.getNodeValue() != null ) // if( detail4Node != null && detail4Node.getNodeValue() != null )
{ {
......
...@@ -34,7 +34,9 @@ public class MRPWizardXmlDataBean ...@@ -34,7 +34,9 @@ public class MRPWizardXmlDataBean
System.out.println("@@@@@@@ getXmlData === xmlString1::::::["+xmlString1+"]@@@@@@@"); System.out.println("@@@@@@@ getXmlData === xmlString1::::::["+xmlString1+"]@@@@@@@");
if (xmlString1 != null && xmlString1.trim().length() > 0) if (xmlString1 != null && xmlString1.trim().length() > 0)
{ {
dom = GenericUtility.getInstance().parseString(xmlString1); GenericUtility genericUtility= new GenericUtility();
// dom = GenericUtility.getInstance().parseString(xmlString1);
dom = genericUtility.parseString(xmlString1);
xmldata = getXmlData(dom); xmldata = getXmlData(dom);
} }
} }
......
...@@ -27,6 +27,8 @@ import ibase.webitm.utility.TransIDGenerator; ...@@ -27,6 +27,8 @@ import ibase.webitm.utility.TransIDGenerator;
public class MrpWizPrsSaveBean public class MrpWizPrsSaveBean
{ {
Set<String> WorkOrderSet = new HashSet<String>();
boolean workOderFlag = false;
public String preSaveForm(String xmlString1 , String chgUser , String chgTerm , String sorderList )throws ITMException public String preSaveForm(String xmlString1 , String chgUser , String chgTerm , String sorderList )throws ITMException
{ {
...@@ -89,7 +91,7 @@ public class MrpWizPrsSaveBean ...@@ -89,7 +91,7 @@ public class MrpWizPrsSaveBean
StockAllocationPrc stockAllocationPrc = new StockAllocationPrc() ; StockAllocationPrc stockAllocationPrc = new StockAllocationPrc() ;
ArrayList itemValueList = new ArrayList(); ArrayList itemValueList = new ArrayList();
ArrayList<String> detail4DataInfoList = new ArrayList<String>(); ArrayList<String> detail4DataInfoList = new ArrayList<String>();
try try
{ {
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
...@@ -309,7 +311,7 @@ public class MrpWizPrsSaveBean ...@@ -309,7 +311,7 @@ public class MrpWizPrsSaveBean
System.out.println("@@@@ctr["+dtlCtr+"]saleOrder["+saleOrder+"]-lineNo["+lineNo+"]-qtyReqd["+qtyReqdStr+"]prevItemWorder["+prevItemWorder+"]previousItem["+previousItem+"]@@@"); System.out.println("@@@@ctr["+dtlCtr+"]saleOrder["+saleOrder+"]-lineNo["+lineNo+"]-qtyReqd["+qtyReqdStr+"]prevItemWorder["+prevItemWorder+"]previousItem["+previousItem+"]@@@");
System.out.println("@@@@ctr["+dtlCtr+"]siteCode["+siteCode+"]-itemCode["+itemCode+"]-lotNo["+lotNo+"]-lotSl["+lotSl+"]-locCode["+locCode+"]-tranSer["+tranSer+"]allocQtyStr["+allocQtyStr+"]@@@"); System.out.println("@@@@ctr["+dtlCtr+"]siteCode["+siteCode+"]-itemCode["+itemCode+"]-lotNo["+lotNo+"]-lotSl["+lotSl+"]-locCode["+locCode+"]-tranSer["+tranSer+"]allocQtyStr["+allocQtyStr+"]@@@");
String detail4DataInfo = checkNull(siteCode)+"@"+checkNull(itemCode)+"@"+checkNull(locCode)+"@"+checkNull(lotNo)+"@"+checkNull(lotSl)+"@"+checkNull(qtyReqdStr); String detail4DataInfo = checkNull(siteCode)+"@"+checkNull(itemCode)+"@"+checkNull(locCode)+"@"+checkNull(lotNo)+"@"+checkNull(lotSl)+"@"+checkNull(qtyReqdStr);
System.out.println("@@@@ detail4DataInfo["+detail4DataInfo+"]detail4DataInfoList["+detail4DataInfoList+"]"); System.out.println("@@@@ detail4DataInfo["+detail4DataInfo+"]detail4DataInfoList["+detail4DataInfoList+"]");
if(detail4DataInfoList.contains(detail4DataInfo)) if(detail4DataInfoList.contains(detail4DataInfo))
...@@ -343,24 +345,109 @@ public class MrpWizPrsSaveBean ...@@ -343,24 +345,109 @@ public class MrpWizPrsSaveBean
// modify for ref_no start on urse 10/10/15 // modify for ref_no start on urse 10/10/15
String refWorkOrder=""; String refWorkOrder="",refItemCode="";
String tempSO="",tempLineNo=""; String tempSO="",tempLineNo="";
ArrayList<String> itemCodeList = new ArrayList<String>();
boolean itemCodeFlag = true;
System.out.println("@@@@@@@@@@@ sorderList["+sorderList+"]"); System.out.println("@@@@@@@@@@@ sorderList["+sorderList+"]");
String sorderArray[]=sorderList.split("@"); String sorderArray[]=sorderList.split("@");
System.out.println("@@@@@ sorderArray.length["+sorderArray.length+"]"); System.out.println("@@@@@ sorderArray.length["+sorderArray.length+"]");
for(int i=0;i<sorderArray.length;i++) for(int i=0;i<sorderArray.length;i++)
{ {
tempSO=sorderArray[i]; tempSO=sorderArray[i];
String sorderLineArray[]=tempSO.split(","); String sorderLineArray[]=tempSO.split(",");
System.out.println("@@@@@ sorderArray.length["+sorderArray.length+"]"); System.out.println("@@@@@ sorderLineArray.length["+sorderLineArray.length+"]");
if( sorderLineArray.length > 1) if( sorderLineArray.length > 1)
{ {
tempSO=sorderLineArray[0]; tempSO=sorderLineArray[0];
tempLineNo=sorderLineArray[1]; tempLineNo=sorderLineArray[1];
} }
int SOCnt1=0,MPSCnt1=0;
if( tempSO != null )
{
sql1=" select count(1) from sorder where sale_order = ? ";
pstmt1=conn.prepareStatement(sql1);
pstmt1.setString(1,tempSO);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
SOCnt1 = rs1.getInt(1);
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null;
System.out.println("@@@@@398:tempSO["+tempSO+"]SOCnt1["+SOCnt1+"]");
if( SOCnt1 > 0 )
{
sql1=" select item_code from sorditem where sale_order = ? and trim(line_no) = ? ";
pstmt1=conn.prepareStatement(sql1);
pstmt1.setString(1,tempSO);
pstmt1.setString(2,tempLineNo);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
refItemCode = checkNull(rs1.getString("item_code"));
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null;
System.out.println("@@@@@ sorditem sorder["+tempSO+"]tempLineNo["+tempLineNo+"]refItemCode["+refItemCode+"]");
}
else
{
sql1=" select count(1) from MPS_ORDER where tran_id = ? ";
pstmt1=conn.prepareStatement(sql1);
pstmt1.setString(1,tempSO);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
MPSCnt1 = rs1.getInt(1);
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null;
System.out.println("@@@@@398:tempSO["+tempSO+"]MPSCnt1["+MPSCnt1+"]");
if( MPSCnt1 > 0)
{
sql1=" select item_code from MPS_ORDER where sale_order = ? ";
pstmt1=conn.prepareStatement(sql1);
pstmt1.setString(1,tempSO);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
refItemCode = checkNull(rs1.getString("item_code"));
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null;
System.out.println("@@@@@ MPS_ORDER["+tempSO+"]refItemCode["+refItemCode+"]");
}
}
System.out.println("@@@@@413:tempSO["+tempSO+"]tempLineNo["+tempLineNo+"]refItemCode["+refItemCode+"]itemCodeList["+itemCodeList+"]");
if(itemCodeList.size() == 0) // added for first time add in list
{
itemCodeList.add(refItemCode);
}
else if(itemCodeList.contains(refItemCode)) // for compare previous item code
{
itemCodeList.add(refItemCode);
}
else // different item code found
{
itemCodeFlag = false;
}
}
System.out.println("@@@@@::: sorder ["+tempSO+"]tempLineNo["+tempLineNo+"] updated next i["+i+"]...."); System.out.println("@@@@@::: sorder ["+tempSO+"]tempLineNo["+tempLineNo+"] updated next i["+i+"]....");
} } //sorderArray.length == 1 added this condition to remove confusion of allocation of 2 MPS or SO ... only for 1 SO / MPS ..WO updated in inv_allocate
if( tempSO != null && tempSO.trim().length() > 0 && tempLineNo != null && tempLineNo.trim().length() > 0 ) System.out.println("@@@@@ final itemCodeFlag["+itemCodeFlag+"]");
if( itemCodeFlag == true && tempSO != null && tempSO.trim().length() > 0 && tempLineNo != null && tempLineNo.trim().length() > 0 )
{ {
System.out.println("@@@@@::test: sorder ["+tempSO+"]tempLineNo["+tempLineNo+"]"); System.out.println("@@@@@::test: sorder ["+tempSO+"]tempLineNo["+tempLineNo+"]");
/*sql1=" select work_order from workorder where sale_order = ? AND site_code = ? "; /*sql1=" select work_order from workorder where sale_order = ? AND site_code = ? ";
...@@ -429,23 +516,64 @@ public class MrpWizPrsSaveBean ...@@ -429,23 +516,64 @@ public class MrpWizPrsSaveBean
System.out.println("@@@@@413:tempSO["+tempSO+"]SOCnt["+SOCnt+"]MPSCnt["+MPSCnt+"]"); System.out.println("@@@@@413:tempSO["+tempSO+"]SOCnt["+SOCnt+"]MPSCnt["+MPSCnt+"]");
if( SOCnt > 0) if( SOCnt > 0)
{ {
sql1=" select work_order from workorder " + /*
sql1 = " select work_order from workorder " +
" where TRAN_ID__MPS in " + " where TRAN_ID__MPS in " +
" ( select tran_id from MPS_ORDER where sale_order = ? and trim(line_no) = ? ) " + " ( select tran_id from MPS_ORDER where sale_order = ? and trim(line_no) = ? ) " +
" order by TRAN_ID__MPS desc "; " order by TRAN_ID__MPS desc ";
*/
sql1 = " select work_order from workorder where TRAN_ID__MPS in " +
" ( select tran_id from MPS_ORDER where ADDN_ORDER like '%"+tempSO+"%' " +
// " //and trim(line_no) = ? " +
" ) order by TRAN_ID__MPS desc ";
pstmt1=conn.prepareStatement(sql1); pstmt1=conn.prepareStatement(sql1);
pstmt1.setString(1,tempSO); // pstmt1.setString(1,tempSO);
pstmt1.setString(2,tempLineNo); // pstmt1.setString(2,tempLineNo);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if(rs1.next()) if(rs1.next())
{ {
refWorkOrder = rs1.getString("work_order"); refWorkOrder = rs1.getString("work_order");
WorkOrderSet.add(refWorkOrder);
} }
rs1.close(); rs1.close();
rs1=null; rs1=null;
pstmt1.close(); pstmt1.close();
pstmt1=null; pstmt1=null;
System.out.println("@@@@@ 1 refWorkOrder from sorder["+tempSO+"] to mps to WO["+refWorkOrder+"]"); System.out.println("@@@@@539 refWorkOrder from sorder["+tempSO+"] to mps to WO["+refWorkOrder+"]");
if( refWorkOrder == null || refWorkOrder.trim().length() == 0 )
{
String tempItemCode="";
sql1=" select item_code from sorddet where sale_order = ? and trim(line_no) = ? "; //added trim() for line no on 07/08/14 by cpatil
pstmt1=conn.prepareStatement(sql1);
pstmt1.setString(1,tempSO);
pstmt1.setString(2,tempLineNo);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
tempItemCode = checkNull(rs1.getString("item_code"));
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null;
sql1 = " select work_order from workorder where sale_order = ? and item_code = ? ";
pstmt1=conn.prepareStatement(sql1);
pstmt1.setString(1,tempSO);
pstmt1.setString(2,tempItemCode);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
refWorkOrder = checkNull(rs1.getString("work_order"));
WorkOrderSet.add(refWorkOrder);
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null;
System.out.println("@@@@@571 refWorkOrder from sorder["+tempSO+"] for made to Order ["+refWorkOrder+"]");
}
} }
if( MPSCnt > 0 && ( refWorkOrder == null || refWorkOrder.trim().length() == 0 ) ) if( MPSCnt > 0 && ( refWorkOrder == null || refWorkOrder.trim().length() == 0 ) )
{ {
...@@ -460,6 +588,7 @@ public class MrpWizPrsSaveBean ...@@ -460,6 +588,7 @@ public class MrpWizPrsSaveBean
if(rs1.next()) if(rs1.next())
{ {
refWorkOrder = rs1.getString("work_order"); refWorkOrder = rs1.getString("work_order");
WorkOrderSet.add(refWorkOrder);
} }
rs1.close(); rs1.close();
rs1=null; rs1=null;
...@@ -469,6 +598,10 @@ public class MrpWizPrsSaveBean ...@@ -469,6 +598,10 @@ public class MrpWizPrsSaveBean
System.out.println("@@@@@ 1 refWorkOrder from MPS["+tempSO+"] to WO["+refWorkOrder+"]"); System.out.println("@@@@@ 1 refWorkOrder from MPS["+tempSO+"] to WO["+refWorkOrder+"]");
} }
} }
else
{
System.out.println("........may be two SO / MPS run in this transaction..............");
}
System.out.println("@@@@@ final refWorkOrder ["+refWorkOrder+"]"); System.out.println("@@@@@ final refWorkOrder ["+refWorkOrder+"]");
// modify for ref_no end on urse 10/10/15 // modify for ref_no end on urse 10/10/15
...@@ -896,6 +1029,32 @@ public class MrpWizPrsSaveBean ...@@ -896,6 +1029,32 @@ public class MrpWizPrsSaveBean
int cnt2 = pstmt2.executeUpdate(); int cnt2 = pstmt2.executeUpdate();
pstmt2.close(); pstmt2.close();
pstmt2 = null; pstmt2 = null;
int MPSCnt2=0;
sql1=" select count(1) from MPS_ORDER where tran_id = ? ";
pstmt1=conn.prepareStatement(sql1);
pstmt1.setString(1,tempSO);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
MPSCnt2 = rs1.getInt(1);
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null;
System.out.println("@@@@@@@@ MPSCnt2["+MPSCnt2+"]");
if( MPSCnt2 > 0 )
{
sql2 = " update mps_order set status = 'C' where tran_id = ? ";
System.out.println("sql :"+sql2 );
pstmt2 = conn.prepareStatement(sql2);
pstmt2.setString(1,tempSO);
int cnt3 = pstmt2.executeUpdate();
pstmt2.close();
pstmt2 = null;
System.out.println("@@@@@ sorditem cnt ["+cnt2+"] mps_order cnt3["+cnt3+"]:::sorditem:::sorder["+tempSO+"]tempLineNo["+tempLineNo+"]alloc_flag[Y]updated sucessfully");
}
/* /*
sql2 = " update sorditem set alloc_flag = 'Y' , qty_alloc= qty_alloc+ ? where sale_order = ? and ltrim(rtrim(line_no)) = ? "; sql2 = " update sorditem set alloc_flag = 'Y' , qty_alloc= qty_alloc+ ? where sale_order = ? and ltrim(rtrim(line_no)) = ? ";
System.out.println("sql2 :"+sql2 ); System.out.println("sql2 :"+sql2 );
...@@ -907,16 +1066,31 @@ public class MrpWizPrsSaveBean ...@@ -907,16 +1066,31 @@ public class MrpWizPrsSaveBean
pstmt2.close(); pstmt2.close();
pstmt2 = null; pstmt2 = null;
*/ */
System.out.println("@@@@@ cnt ["+cnt2+"]:::sorditem:::sorder["+tempSO+"]tempLineNo["+tempLineNo+"]alloc_flag[Y]updated sucessfully");
} }
// update workorder status as A when click on finish....
Iterator iterator = WorkOrderSet.iterator();
while (iterator.hasNext())
{
String workOrderA = "";
workOrderA = checkNull(iterator.next().toString());
System.out.println("workOrderA["+workOrderA+"]");
if( workOrderA != null && workOrderA.trim().length() > 0 )
{
sql2 = " update workorder set status = 'A' where work_order = ? ";
System.out.println("sql2 :"+sql2 );
pstmt2 = conn.prepareStatement(sql2);
pstmt2.setString(1,workOrderA);
int cnt2 = pstmt2.executeUpdate();
pstmt2.close();
pstmt2 = null;
System.out.println("@@@@@@ workorder:::workOrderA["+workOrderA+"]cnt2["+cnt2+"]status = A");
}
}
} }
//end //end
// end insertion logic // end insertion logic
}//try end }//try end
catch (SQLException sqx) catch (SQLException sqx)
......
...@@ -79,7 +79,7 @@ import org.w3c.dom.Document; ...@@ -79,7 +79,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap; import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node; import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
// added for ejb3 //added for ejb3
//12/04/10 manoharan MF90BHU003 //12/04/10 manoharan MF90BHU003
//import org.apache.poi.xssf.usermodel.*; //import org.apache.poi.xssf.usermodel.*;
//import org.apache.poi.ss.util.CellRangeAddress; //import org.apache.poi.ss.util.CellRangeAddress;
...@@ -251,7 +251,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -251,7 +251,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
int bomLevel=0; int bomLevel=0;
String[] arrStr = null; String[] arrStr = null;
String xtraParams=""; String xtraParams="";
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException, ITMException public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException, ITMException
{ {
System.out.println("Called process(string, string).....xtraParams["+xtraParams+"]"); System.out.println("Called process(string, string).....xtraParams["+xtraParams+"]");
...@@ -323,7 +323,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -323,7 +323,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if( this.xtraParams == null || this.xtraParams.trim().length() == 0 ) if( this.xtraParams == null || this.xtraParams.trim().length() == 0 )
{ {
System.out.println("before this.xtraParams ["+ this.xtraParams +"]"); System.out.println("before this.xtraParams ["+ this.xtraParams +"]");
this.xtraParams = xtraParams; this.xtraParams = xtraParams;
System.out.println("after this.xtraParams ["+ this.xtraParams +"]"); System.out.println("after this.xtraParams ["+ this.xtraParams +"]");
} }
...@@ -7394,6 +7394,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -7394,6 +7394,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
sqlMpsOrder = "DELETE FROM MPS_ORDER " + "WHERE SITE_CODE = ? " + "AND ITEM_CODE = ? "+ " AND STATUS in ('M')";//Manoj dtd 14/07/2014 Status Changed from N to M sqlMpsOrder = "DELETE FROM MPS_ORDER " + "WHERE SITE_CODE = ? " + "AND ITEM_CODE = ? "+ " AND STATUS in ('M')";//Manoj dtd 14/07/2014 Status Changed from N to M
sqlWorkOrder = "DELETE FROM WORKORDER " + "WHERE SITE_CODE = ? " + "AND ITEM_CODE = ? " + " AND STATUS in ('M')"; // replace ORDER_TYPE inplace of STATUS column ... 17/06/14... sqlWorkOrder = "DELETE FROM WORKORDER " + "WHERE SITE_CODE = ? " + "AND ITEM_CODE = ? " + " AND STATUS in ('M')"; // replace ORDER_TYPE inplace of STATUS column ... 17/06/14...
if( isDetailReq ) // added for remove FK_WORKORDER_CAMGIAN constrainst when already allocation against campwise
{
sqlWorkOrder = sqlWorkOrder + " and campgn_no is null ";
}
sqlDistDemand = "DELETE FROM DIST_DEMAND " + " WHERE STATUS = 'P' " + "AND SITE_CODE = ? " + "AND ITEM_CODE = ? "; sqlDistDemand = "DELETE FROM DIST_DEMAND " + " WHERE STATUS = 'P' " + "AND SITE_CODE = ? " + "AND ITEM_CODE = ? ";
if (matPlan.equals("Y")) if (matPlan.equals("Y"))
...@@ -7429,17 +7435,29 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -7429,17 +7435,29 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
// comment code for not deleting workorder // comment code for not deleting workorder
if (mfgType != null && ((mfgType.trim()).equalsIgnoreCase("O"))) if( isDetailReq ) //added for supreme on 02/11/15 for delete both workorder
{ {
pstmt = conn.prepareStatement(sqlWorkOrder); pstmt = conn.prepareStatement(sqlWorkOrder);
pstmt.setString(1, siteCode); pstmt.setString(1, siteCode);
pstmt.setString(2, itemCode); pstmt.setString(2, itemCode);
rowsDeleted = pstmt.executeUpdate(); rowsDeleted = pstmt.executeUpdate();
System.out.println("Rows Deleted in WorkOrder :" + rowsDeleted); System.out.println("Rows Deleted in WorkOrder :" + rowsDeleted);
conn.commit(); conn.commit();
pstmt.close(); pstmt.close();
}
else
{
if (mfgType != null && ((mfgType.trim()).equalsIgnoreCase("O")))
{
pstmt = conn.prepareStatement(sqlWorkOrder);
pstmt.setString(1, siteCode);
pstmt.setString(2, itemCode);
rowsDeleted = pstmt.executeUpdate();
System.out.println("Rows Deleted in WorkOrder :" + rowsDeleted);
conn.commit();
pstmt.close();
}
} }
} }
if (disPlan.equals("Y")) if (disPlan.equals("Y"))
...@@ -8764,7 +8782,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -8764,7 +8782,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
boolean insertFlag = true; // added by cpatil for new req boolean insertFlag = true; // added by cpatil for new req
ArrayList<String> tranIdList = new ArrayList<String>(); ArrayList<String> tranIdList = new ArrayList<String>();
try try
{ {
System.out.println("@@@@@@@@@cpatil:InsertPlanDemand called----winName["+winName+"] list["+list+"]--------"); System.out.println("@@@@@@@@@cpatil:InsertPlanDemand called----winName["+winName+"] list["+list+"]--------");
...@@ -9048,7 +9066,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -9048,7 +9066,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
System.out.println("for MpsOrder...itemCode["+itemCode+"]addnOrder["+addnOrder+"]mpsOrder.mfgType["+mpsOrder.mfgType+"]orderType["+orderType+"]"); System.out.println("for MpsOrder...itemCode["+itemCode+"]addnOrder["+addnOrder+"]mpsOrder.mfgType["+mpsOrder.mfgType+"]orderType["+orderType+"]");
/* /*
if( isDetailReq ) // added on 14/10/15 @supreme if( isDetailReq ) // added on 14/10/15 @supreme
{ {
if( "MPS".equals(orderType) && "S".equalsIgnoreCase(mpsOrder.mfgType)) if( "MPS".equals(orderType) && "S".equalsIgnoreCase(mpsOrder.mfgType))
...@@ -9057,112 +9075,112 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -9057,112 +9075,112 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
System.out.println("@@@@@ insertFlag["+insertFlag+"]"); System.out.println("@@@@@ insertFlag["+insertFlag+"]");
} }
} }
*/ */
// if(insertFlag) // if(insertFlag)
// { // {
tranIdMpsOrder = getUniqueKey(xmlValues, mpsKeyStr, "tran_id", "W-MPS"); tranIdMpsOrder = getUniqueKey(xmlValues, mpsKeyStr, "tran_id", "W-MPS");
pstmtMpsOrder.setString(1, tranIdMpsOrder); pstmtMpsOrder.setString(1, tranIdMpsOrder);
pstmtMpsOrder.setString(2, ordType); pstmtMpsOrder.setString(2, ordType);
pstmtMpsOrder.setString(3, itemCode); pstmtMpsOrder.setString(3, itemCode);
pstmtMpsOrder.setString(4, siteCode); pstmtMpsOrder.setString(4, siteCode);
pstmtMpsOrder.setDouble(5, quantity); pstmtMpsOrder.setDouble(5, quantity);
pstmtMpsOrder.setTimestamp(6, ordDate); pstmtMpsOrder.setTimestamp(6, ordDate);
pstmtMpsOrder.setTimestamp(7, planDueDate); pstmtMpsOrder.setTimestamp(7, planDueDate);
pstmtMpsOrder.setString(8, mrpRunId); pstmtMpsOrder.setString(8, mrpRunId);
pstmtMpsOrder.setString(9, addnOrder); pstmtMpsOrder.setString(9, addnOrder);
pstmtMpsOrder.setTimestamp(10, dueDate); pstmtMpsOrder.setTimestamp(10, dueDate);
pstmtMpsOrder.setString(11, "M");//Manoj dtd 14/07/2014 Status Changed from P to M pstmtMpsOrder.setString(11, "M");//Manoj dtd 14/07/2014 Status Changed from P to M
pstmtMpsOrder.setTimestamp(12, statusDate); pstmtMpsOrder.setTimestamp(12, statusDate);
pstmtMpsOrder.setDouble(13, yieldPerc); pstmtMpsOrder.setDouble(13, yieldPerc);
pstmtMpsOrder.setString(14, routeCode); pstmtMpsOrder.setString(14, routeCode);
pstmtMpsOrder.setString(15, bomCode); pstmtMpsOrder.setString(15, bomCode);
pstmtMpsOrder.setString(16, projCode); pstmtMpsOrder.setString(16, projCode);
pstmtMpsOrder.setTimestamp(17, chgDate); pstmtMpsOrder.setTimestamp(17, chgDate);
pstmtMpsOrder.setString(18, chgUser); pstmtMpsOrder.setString(18, chgUser);
pstmtMpsOrder.setString(19, chgTerm); pstmtMpsOrder.setString(19, chgTerm);
pstmtMpsOrder.setString(20, unit); pstmtMpsOrder.setString(20, unit);
pstmtMpsOrder.setString(21, acctCodeWp); pstmtMpsOrder.setString(21, acctCodeWp);
pstmtMpsOrder.setString(22, cctrCodeWp); pstmtMpsOrder.setString(22, cctrCodeWp);
pstmtMpsOrder.setDouble(23, quantity); pstmtMpsOrder.setDouble(23, quantity);
pstmtMpsOrder.setString(24, unit); pstmtMpsOrder.setString(24, unit);
pstmtMpsOrder.setDouble(25, quantity); pstmtMpsOrder.setDouble(25, quantity);
pstmtMpsOrder.setDouble(26, 1); pstmtMpsOrder.setDouble(26, 1);
if (saleOrder != null && saleOrder.trim().length() > 0) if (saleOrder != null && saleOrder.trim().length() > 0)
{ {
pstmtMpsOrder.setString(27, saleOrder); pstmtMpsOrder.setString(27, saleOrder);
} else } else
{ {
pstmtMpsOrder.setNull(27, java.sql.Types.CHAR); pstmtMpsOrder.setNull(27, java.sql.Types.CHAR);
} }
if (lineNo != null && lineNo.trim().length() > 0) if (lineNo != null && lineNo.trim().length() > 0)
{ {
pstmtMpsOrder.setString(28, lineNo); pstmtMpsOrder.setString(28, lineNo);
} else } else
{ {
pstmtMpsOrder.setNull(28, java.sql.Types.CHAR); pstmtMpsOrder.setNull(28, java.sql.Types.CHAR);
} }
if( isDetailReq ) // added for supreme loc_group on 28/09/15 if( isDetailReq ) // added for supreme loc_group on 28/09/15
{ {
System.out.println("@@@@@final---locGroupMap["+locGroupMap+"]]"); System.out.println("@@@@@final---locGroupMap["+locGroupMap+"]]");
String tempLocGroup=""; String tempLocGroup="";
Set s1=locGroupMap.entrySet(); Set s1=locGroupMap.entrySet();
Iterator itr=s1.iterator(); Iterator itr=s1.iterator();
while(itr.hasNext()) while(itr.hasNext())
{
Map.Entry m=(Map.Entry)itr.next();
{ {
Map.Entry m=(Map.Entry)itr.next(); String keyListStr = m.getKey().toString();
{ tempLocGroup = locGroupMap.get(keyListStr).toString();
String keyListStr = m.getKey().toString(); break;
tempLocGroup = locGroupMap.get(keyListStr).toString();
break;
}
} }
pstmtMpsOrder.setString(29,tempLocGroup);
}
else
{
pstmtMpsOrder.setString(29,"");
} }
pstmtMpsOrder.setString(29,tempLocGroup);
}
else
{
pstmtMpsOrder.setString(29,"");
}
// **************pstmtMpsOrder.setDouble(25, demandQty); // **************pstmtMpsOrder.setDouble(25, demandQty);
pstmtMpsOrder.addBatch(); pstmtMpsOrder.addBatch();
WOtranId = tranIdMpsOrder; WOtranId = tranIdMpsOrder;
if( isDetailReq && tranIdMpsOrder!= null && tranIdMpsOrder.trim().length() > 0 && "S".equalsIgnoreCase(mpsOrder.mfgType)) if( isDetailReq && tranIdMpsOrder!= null && tranIdMpsOrder.trim().length() > 0 && "S".equalsIgnoreCase(mpsOrder.mfgType))
{ {
System.out.println("tranIdMpsOrder["+tranIdMpsOrder+"]"); System.out.println("tranIdMpsOrder["+tranIdMpsOrder+"]");
tranIdList.add(tranIdMpsOrder); tranIdList.add(tranIdMpsOrder);
System.out.println("tranIdList["+tranIdList+"]"); System.out.println("tranIdList["+tranIdList+"]");
} }
// }// end of insert flag
// else
// {
// System.out.println("@@@@@@@@@@:9140::saleOrder["+saleOrder+"]");
// if( saleOrder != null && saleOrder.trim().length() > 0 )
// {
// tranIdList.add(saleOrder);
// }
// }
// }// end of insert flag
// else
// {
// System.out.println("@@@@@@@@@@:9140::saleOrder["+saleOrder+"]");
// if( saleOrder != null && saleOrder.trim().length() > 0 )
// {
// tranIdList.add(saleOrder);
// }
// }
/*if( isDetailReq ) // add for mpsToWorkOrder on 14/10/15 @urse by cpatil /*if( isDetailReq ) // add for mpsToWorkOrder on 14/10/15 @urse by cpatil
{ {
String xtraParams="", windowName="mps_to_wo"; String xtraParams="", windowName="mps_to_wo";
WorkorderPrc mpsToWorkOrder = new WorkorderPrc(); WorkorderPrc mpsToWorkOrder = new WorkorderPrc();
//errString = mpsToWorkOrder.process(xmlValues, xmlValues, windowName, xtraParams); //errString = mpsToWorkOrder.process(xmlValues, xmlValues, windowName, xtraParams);
System.out.println("@@@@@@ tranIdList["+tranIdList+"]"); System.out.println("@@@@@@ tranIdList["+tranIdList+"]");
errString = mpsToWorkOrder.calWorkorderPrc( tranIdList, conn); errString = mpsToWorkOrder.calWorkorderPrc( tranIdList, conn);
System.out.println("@@@@@@ errString["+errString+"]"); System.out.println("@@@@@@ errString["+errString+"]");
}*/ }*/
} }
// System.out.println("Inserting mpsorder # " + count + // System.out.println("Inserting mpsorder # " + count +
// " : " + tranIdMpsOrder); // " : " + tranIdMpsOrder);
...@@ -9524,9 +9542,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -9524,9 +9542,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// Commented by Jiten 31/10/06 - error -null pointer Exception // Commented by Jiten 31/10/06 - error -null pointer Exception
// pstmtMpsOrder.clearParameters(); // pstmtMpsOrder.clearParameters();
pstmtMpsOrder.close(); pstmtMpsOrder.close();
// End // End
// conn.commit(); // conn.commit();
...@@ -9548,8 +9566,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -9548,8 +9566,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// pstmtIndDemand.clearParameters();//Commented by Jiten 14/11/06 as // pstmtIndDemand.clearParameters();//Commented by Jiten 14/11/06 as
// giving null pointer exception // giving null pointer exception
pstmtIndDemand.close(); pstmtIndDemand.close();
if( isDetailReq ) // add for mpsToWorkOrder on 14/10/15 @urse by cpatil if( isDetailReq ) // add for mpsToWorkOrder on 14/10/15 @urse by cpatil
{ {
//String windowName="mps_to_wo"; //String windowName="mps_to_wo";
...@@ -9559,12 +9577,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -9559,12 +9577,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if( tranIdList.size() > 0) if( tranIdList.size() > 0)
{ {
//errString = mpsToWorkOrder.calWorkorderPrc( tranIdList, conn); //errString = mpsToWorkOrder.calWorkorderPrc( tranIdList, conn);
errString = mpsToWorkOrder.calWorkorderPrc( tranIdList, conn,xtraParams); errString = mpsToWorkOrder.calWorkorderPrc( tranIdList, conn,xtraParams, true);
} }
System.out.println("@@@@@@ errString["+errString+"]"); System.out.println("@@@@@@ errString["+errString+"]");
} }
conn.commit(); 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 Mps Order : [" + rowsInsertedMpsOrder.length + "]");
...@@ -10064,6 +10082,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -10064,6 +10082,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
for (int ctr3=0; ctr3 < IPD_MPS_ORDER.size();ctr3++) for (int ctr3=0; ctr3 < IPD_MPS_ORDER.size();ctr3++)
{ {
count1++; count1++;
/*if( count1 == count) // added for remove same dbid occure in detail2 and detail4 ... on @urse 04/11/15 by cpatil
{
System.out.println("@@@@@10087::count1["+count1+"]count["+count+"]");
count1++;
System.out.println("@@@@@10124::count1["+count1+"]");
}*/
HashMap tempMap = new HashMap(); HashMap tempMap = new HashMap();
tempMap = (HashMap) IPD_MPS_ORDER.get(ctr3); tempMap = (HashMap) IPD_MPS_ORDER.get(ctr3);
...@@ -10100,6 +10124,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -10100,6 +10124,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
for (int ctr3=0; ctr3 < IPD_INDENT.size();ctr3++) for (int ctr3=0; ctr3 < IPD_INDENT.size();ctr3++)
{ {
count1++; count1++;
/*if( count1 == count) // added for remove same dbid occure in detail2 and detail4 ... on @urse 04/11/15 by cpatil
{
System.out.println("@@@@@10124::count1["+count1+"]count["+count+"]");
count1++;
System.out.println("@@@@@10124::count1["+count1+"]");
}*/
HashMap tempMap = new HashMap(); HashMap tempMap = new HashMap();
tempMap = (HashMap) IPD_INDENT.get(ctr3); tempMap = (HashMap) IPD_INDENT.get(ctr3);
...@@ -10132,6 +10162,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -10132,6 +10162,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
for (int ctr3=0; ctr3 < IPD_DIST.size();ctr3++) for (int ctr3=0; ctr3 < IPD_DIST.size();ctr3++)
{ {
count1++; count1++;
/*if( count1 == count) // added for remove same dbid occure in detail2 and detail4 ... on @urse 04/11/15 by cpatil
{
System.out.println("@@@@@10167::count1["+count1+"]count["+count+"]");
count1++;
System.out.println("@@@@@10124::count1["+count1+"]");
}*/
HashMap tempMap = new HashMap(); HashMap tempMap = new HashMap();
tempMap = (HashMap) IPD_DIST.get(ctr3); tempMap = (HashMap) IPD_DIST.get(ctr3);
...@@ -10164,6 +10200,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -10164,6 +10200,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
for (int ctr3=0; ctr3 < IPD_INDEPENDENT.size();ctr3++) for (int ctr3=0; ctr3 < IPD_INDEPENDENT.size();ctr3++)
{ {
count1++; count1++;
/*if( count1 == count) // added for remove same dbid occure in detail2 and detail4 ... on @urse 04/11/15 by cpatil
{
System.out.println("@@@@@10203::count1["+count1+"]count["+count+"]");
count1++;
System.out.println("@@@@@10124::count1["+count1+"]");
}*/
HashMap tempMap = new HashMap(); HashMap tempMap = new HashMap();
tempMap = (HashMap) IPD_INDEPENDENT.get(ctr3); tempMap = (HashMap) IPD_INDEPENDENT.get(ctr3);
...@@ -10978,6 +11020,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -10978,6 +11020,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
System.out.println("@@@@@@@@@@@ inside dettimeCtr["+dettimeCtr+"]"); System.out.println("@@@@@@@@@@@ inside dettimeCtr["+dettimeCtr+"]");
count1++; count1++;
/*if( count1 == count) // added for remove same dbid occure in detail2 and detail4 ... on @urse 04/11/15 by cpatil
{
System.out.println("@@@@@11025::count1["+count1+"]count["+count+"]");
count1++;
System.out.println("@@@@@10124::count1["+count1+"]");
}*/
valueXmlString.append("<Detail4 domID='" + count1 + "' >\r\n"); valueXmlString.append("<Detail4 domID='" + count1 + "' >\r\n");
String altItemPerc = detadpElement.getAltitemPerc(); String altItemPerc = detadpElement.getAltitemPerc();
......
...@@ -356,7 +356,9 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal, ...@@ -356,7 +356,9 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
CommonConstants commonConstants = new CommonConstants(); CommonConstants commonConstants = new CommonConstants();
String itemCodeInv=""; double quantityInv=0,issueQtyInv=0; // added by cpatil String itemCodeInv=""; double quantityInv=0,issueQtyInv=0; // added by cpatil
double noArt = 0,netWeight = 0, grossWeight=0, stkQty=0; // added by cpatil on 02/04/15 urse double noArt = 0,netWeight = 0, grossWeight=0, stkQty=0; // added by cpatil on 02/04/15 urse
String lineNoInvAllocDet="";
try try
{ {
...@@ -537,7 +539,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal, ...@@ -537,7 +539,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
if(flag == false) if(flag == false)
{ {
//sql2 = " SELECT LOC_CODE,LOT_NO,LOT_SL FROM INV_ALLOC_DET WHERE TRAN_ID IN (SELECT TRAN_ID FROM INV_ALLOCATE WHERE WORK_ORDER = ? ) AND ITEM_CODE = ? "; //sql2 = " SELECT LOC_CODE,LOT_NO,LOT_SL FROM INV_ALLOC_DET WHERE TRAN_ID IN (SELECT TRAN_ID FROM INV_ALLOCATE WHERE WORK_ORDER = ? ) AND ITEM_CODE = ? ";
sql2 = " SELECT LOC_CODE,LOT_NO,LOT_SL,ITEM_CODE,SITE_CODE, quantity , issue_qty " + sql2 = " SELECT LOC_CODE,LOT_NO,LOT_SL,ITEM_CODE,SITE_CODE, quantity , issue_qty, line_no " +
" FROM INV_ALLOC_DET " + " FROM INV_ALLOC_DET " +
" WHERE TRAN_ID IN (SELECT TRAN_ID FROM INV_ALLOCATE WHERE WORK_ORDER = ? ) " + " WHERE TRAN_ID IN (SELECT TRAN_ID FROM INV_ALLOCATE WHERE WORK_ORDER = ? ) " +
" and 'Y' <> case when deallocated is null then 'N' else deallocated end " + " and 'Y' <> case when deallocated is null then 'N' else deallocated end " +
...@@ -557,10 +559,13 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal, ...@@ -557,10 +559,13 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
siteCode =rs2.getString("SITE_CODE"); siteCode =rs2.getString("SITE_CODE");
quantityInv =rs2.getDouble("quantity"); quantityInv =rs2.getDouble("quantity");
issueQtyInv =rs2.getDouble("issue_qty"); issueQtyInv =rs2.getDouble("issue_qty");
lineNoInvAllocDet =rs2.getString("LINE_NO"); // added by cpatil for line_no not set in update querry @urse 14/10/15
String propReqQtyStr = df.format(propReqQty); //String propReqQtyStr = df.format(propReqQty);
System.out.println("@@@@lineNoInvAllocDet["+lineNoInvAllocDet+"]quantityInv["+quantityInv+"]");
String propReqQtyStr = df.format(quantityInv);
System.out.println("@@@@propReqQtyStr["+propReqQtyStr+"]");
propReqQty = Double.parseDouble(propReqQtyStr); propReqQty = Double.parseDouble(propReqQtyStr);
System.out.println("propReqQty @@@::["+propReqQty+"]for item["+itemCode + "]quantityInv["+quantityInv+"]issueQtyInv["+issueQtyInv+"]"); System.out.println("propReqQty @@@::["+propReqQty+"]for item["+itemCode + "]quantityInv["+quantityInv+"]issueQtyInv["+issueQtyInv+"]lineNoInvAllocDet["+lineNoInvAllocDet+"]");
/* /*
stockSql ="select a.lot_no, a.loc_code, a.lot_sl, a.rate, a.gross_rate,a.supp_code__mfg " stockSql ="select a.lot_no, a.loc_code, a.lot_sl, a.rate, a.gross_rate,a.supp_code__mfg "
+" ,(a.quantity-a.alloc_qty) as stockBalQty " +" ,(a.quantity-a.alloc_qty) as stockBalQty "
...@@ -823,7 +828,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal, ...@@ -823,7 +828,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
+ " dealloc_qty = (CASE WHEN dealloc_qty IS NULL THEN 0 ELSE dealloc_qty END) + ?" + " dealloc_qty = (CASE WHEN dealloc_qty IS NULL THEN 0 ELSE dealloc_qty END) + ?"
+ " where tran_id in (select tran_id from inv_allocate where work_order = ? )" + " where tran_id in (select tran_id from inv_allocate where work_order = ? )"
+ " and item_code = ? and lot_sl= ? and lot_no = ? and site_code= ? and loc_code = ? " + " and item_code = ? and lot_sl= ? and lot_no = ? and site_code= ? and loc_code = ? "
+ " and exp_lev = ? "; + " and exp_lev = ? and line_no = ? ";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setDouble(1,propReqQty); pstmt1.setDouble(1,propReqQty);
pstmt1.setDouble(2,propReqQty); pstmt1.setDouble(2,propReqQty);
...@@ -834,6 +839,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal, ...@@ -834,6 +839,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
pstmt1.setString(7,siteCode); pstmt1.setString(7,siteCode);
pstmt1.setString(8,locCode); pstmt1.setString(8,locCode);
pstmt1.setString(9,expLev); pstmt1.setString(9,expLev);
pstmt1.setString(10,lineNoInvAllocDet); // added by cpatil for line_no not set in update querry @urse 14/10/15
int cnt=pstmt1.executeUpdate(); int cnt=pstmt1.executeUpdate();
System.out.println("Count after PSTM is:- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%["+cnt+"]"); System.out.println("Count after PSTM is:- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%["+cnt+"]");
pstmt1.close();pstmt1=null; pstmt1.close();pstmt1=null;
......
...@@ -1608,7 +1608,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1608,7 +1608,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
actualPropQty=Double.parseDouble(""+hashMap.get("alloc_qty"));//Changed by Manoj dtd 20/08/15 Set value from map instead of dom value actualPropQty=Double.parseDouble(""+hashMap.get("alloc_qty"));//Changed by Manoj dtd 20/08/15 Set value from map instead of dom value
int count = 0,recIn=0 ; int count = 0,recIn=0 ;
sql = " select count(*) from inv_alloc_det where tran_id = ? and item_code = ? and lot_no = ? " sql = " select count(*) from inv_alloc_det where tran_id = ? and item_code = ? and lot_no = ? "
+ "and lot_sl = ? and loc_code = ? and site_code = ? and exp_lev=? and case when deallocated is null then 'N' else deallocated end <> 'Y' "; + "and lot_sl = ? and loc_code = ? and site_code = ? and exp_lev=? " +
" and case when deallocated is null then 'N' else deallocated end <> 'Y' ";
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setString(1,tranId); pstmt.setString(1,tranId);
pstmt.setString(2,itemCode); pstmt.setString(2,itemCode);
......
...@@ -2727,7 +2727,7 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL ...@@ -2727,7 +2727,7 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
} }
return retVal; return retVal;
} }
@Override
public ArrayList getDetails(String woCode) throws ITMException public ArrayList getDetails(String woCode) throws ITMException
{ {
System.out.println("---getDetails method called12345-------------------"); System.out.println("---getDetails method called12345-------------------");
......
...@@ -479,15 +479,16 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko ...@@ -479,15 +479,16 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
public String calWorkorderPrc(ArrayList tranList,Connection conn) throws Exception,ITMException public String calWorkorderPrc(ArrayList tranList,Connection conn) throws Exception,ITMException
{ {
String errString="", xtraParams=""; String errString="", xtraParams="";
errString=calWorkorderPrc(tranList,conn,xtraParams); boolean fromMRP= false;
errString=calWorkorderPrc(tranList,conn,xtraParams,fromMRP);
System.out.println("calWorkorderPrc(tranList,conn,xtraParams)@@@errString["+errString+"]"); System.out.println("calWorkorderPrc(tranList,conn,xtraParams)@@@errString["+errString+"]");
return errString; return errString;
} }
public String calWorkorderPrc(ArrayList tranList,Connection conn, String xtraParams) throws Exception,ITMException public String calWorkorderPrc(ArrayList tranList,Connection conn, String xtraParams, boolean fromMRP) throws Exception,ITMException
{ {
System.out.println("@@@@@@@@@@@ calWorkorderPrc()............"); System.out.println("@@@@@@@@@@@ calWorkorderPrc()...........fromMRP["+fromMRP+"]");
ResultSet rs1 = null,rsSql1=null,rsSql2=null; ResultSet rs1 = null,rsSql1=null,rsSql2=null;
PreparedStatement pstmt = null,pstmtInsert=null,pstmtUpdate=null,pstmtSql1=null,pstmtSql2=null; PreparedStatement pstmt = null,pstmtInsert=null,pstmtUpdate=null,pstmtSql1=null,pstmtSql2=null;
...@@ -510,6 +511,7 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko ...@@ -510,6 +511,7 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
this.chgTerm = blanknull(this.chgTerm).trim(); this.chgTerm = blanknull(this.chgTerm).trim();
} }
System.out.println("[WorkorderPrc][calWorkorderPrc][loginCode]=>["+loginCode+"]this.loginCode["+this.loginCode+"]"); System.out.println("[WorkorderPrc][calWorkorderPrc][loginCode]=>["+loginCode+"]this.loginCode["+this.loginCode+"]");
System.out.println("[WorkorderPrc][calWorkorderPrc][chgTerm]=>["+chgTerm+"]this.chgTerm ["+this.chgTerm +"]"); System.out.println("[WorkorderPrc][calWorkorderPrc][chgTerm]=>["+chgTerm+"]this.chgTerm ["+this.chgTerm +"]");
...@@ -730,7 +732,16 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko ...@@ -730,7 +732,16 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
System.out.println("[WorkorderPrc]=>"+java.sql.Timestamp.valueOf(getCurrdateAppFormat().toString())); System.out.println("[WorkorderPrc]=>"+java.sql.Timestamp.valueOf(getCurrdateAppFormat().toString()));
pstmtInsert.setTimestamp(16,java.sql.Timestamp.valueOf(getCurrdateAppFormat().toString()));//for ord_date pstmtInsert.setTimestamp(16,java.sql.Timestamp.valueOf(getCurrdateAppFormat().toString()));//for ord_date
pstmtInsert.setTimestamp(17,java.sql.Timestamp.valueOf(dueDate.trim()));//for due_date pstmtInsert.setTimestamp(17,java.sql.Timestamp.valueOf(dueDate.trim()));//for due_date
pstmtInsert.setString(18,"P");//for status
if( fromMRP ) // added for delete workworder created from mrp. // if true means wo crete from mrp otherwise normal MPS to WO // status M help at the time of delete WO.
{
pstmtInsert.setString(18,"M");//for status
}
else
{
pstmtInsert.setString(18,"P");//for status
}
pstmtInsert.setTimestamp(19,new Timestamp(System.currentTimeMillis()));//for status_date pstmtInsert.setTimestamp(19,new Timestamp(System.currentTimeMillis()));//for status_date
if("Y".equalsIgnoreCase(feedbackReqd)) // added for feedback req 'Y' for supreme on 23/09/15 by cpatil if("Y".equalsIgnoreCase(feedbackReqd)) // added for feedback req 'Y' for supreme on 23/09/15 by cpatil
......
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