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
{
Node detail4Node = detail4List.item(cntr);
//NodeList detail4NodeList = detail4Node.getChildNodes();
System.out.println("@@@@@@@@@node name[" + detail4Node.getNodeName()+"]");
//System.out.println("@@@@@@@@@node name[" + detail4Node.getNodeName()+"]");
// if( detail4Node != null && detail4Node.getNodeValue() != null )
{
......
......@@ -34,7 +34,9 @@ public class MRPWizardXmlDataBean
System.out.println("@@@@@@@ getXmlData === xmlString1::::::["+xmlString1+"]@@@@@@@");
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);
}
}
......
......@@ -27,6 +27,8 @@ import ibase.webitm.utility.TransIDGenerator;
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
{
......@@ -89,7 +91,7 @@ public class MrpWizPrsSaveBean
StockAllocationPrc stockAllocationPrc = new StockAllocationPrc() ;
ArrayList itemValueList = new ArrayList();
ArrayList<String> detail4DataInfoList = new ArrayList<String>();
try
{
conn = connDriver.getConnectDB("DriverITM");
......@@ -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+"]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);
System.out.println("@@@@ detail4DataInfo["+detail4DataInfo+"]detail4DataInfoList["+detail4DataInfoList+"]");
if(detail4DataInfoList.contains(detail4DataInfo))
......@@ -343,24 +345,109 @@ public class MrpWizPrsSaveBean
// modify for ref_no start on urse 10/10/15
String refWorkOrder="";
String refWorkOrder="",refItemCode="";
String tempSO="",tempLineNo="";
ArrayList<String> itemCodeList = new ArrayList<String>();
boolean itemCodeFlag = true;
System.out.println("@@@@@@@@@@@ sorderList["+sorderList+"]");
String sorderArray[]=sorderList.split("@");
System.out.println("@@@@@ sorderArray.length["+sorderArray.length+"]");
for(int i=0;i<sorderArray.length;i++)
{
tempSO=sorderArray[i];
String sorderLineArray[]=tempSO.split(",");
System.out.println("@@@@@ sorderArray.length["+sorderArray.length+"]");
System.out.println("@@@@@ sorderLineArray.length["+sorderLineArray.length+"]");
if( sorderLineArray.length > 1)
{
tempSO=sorderLineArray[0];
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+"]....");
}
if( tempSO != null && tempSO.trim().length() > 0 && tempLineNo != null && tempLineNo.trim().length() > 0 )
} //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
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+"]");
/*sql1=" select work_order from workorder where sale_order = ? AND site_code = ? ";
......@@ -429,23 +516,64 @@ public class MrpWizPrsSaveBean
System.out.println("@@@@@413:tempSO["+tempSO+"]SOCnt["+SOCnt+"]MPSCnt["+MPSCnt+"]");
if( SOCnt > 0)
{
sql1=" select work_order from workorder " +
/*
sql1 = " select work_order from workorder " +
" where TRAN_ID__MPS in " +
" ( 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.setString(1,tempSO);
pstmt1.setString(2,tempLineNo);
// pstmt1.setString(1,tempSO);
// pstmt1.setString(2,tempLineNo);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
refWorkOrder = rs1.getString("work_order");
WorkOrderSet.add(refWorkOrder);
}
rs1.close();
rs1=null;
pstmt1.close();
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 ) )
{
......@@ -460,6 +588,7 @@ public class MrpWizPrsSaveBean
if(rs1.next())
{
refWorkOrder = rs1.getString("work_order");
WorkOrderSet.add(refWorkOrder);
}
rs1.close();
rs1=null;
......@@ -469,6 +598,10 @@ public class MrpWizPrsSaveBean
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+"]");
// modify for ref_no end on urse 10/10/15
......@@ -896,6 +1029,32 @@ public class MrpWizPrsSaveBean
int cnt2 = pstmt2.executeUpdate();
pstmt2.close();
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)) = ? ";
System.out.println("sql2 :"+sql2 );
......@@ -907,16 +1066,31 @@ public class MrpWizPrsSaveBean
pstmt2.close();
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 insertion logic
}//try end
catch (SQLException sqx)
......
......@@ -79,7 +79,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
// added for ejb3
//added for ejb3
//12/04/10 manoharan MF90BHU003
//import org.apache.poi.xssf.usermodel.*;
//import org.apache.poi.ss.util.CellRangeAddress;
......@@ -251,7 +251,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
int bomLevel=0;
String[] arrStr = null;
String xtraParams="";
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException, ITMException
{
System.out.println("Called process(string, string).....xtraParams["+xtraParams+"]");
......@@ -323,7 +323,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if( this.xtraParams == null || this.xtraParams.trim().length() == 0 )
{
System.out.println("before this.xtraParams ["+ this.xtraParams +"]");
this.xtraParams = xtraParams;
this.xtraParams = xtraParams;
System.out.println("after this.xtraParams ["+ this.xtraParams +"]");
}
......@@ -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
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 = ? ";
if (matPlan.equals("Y"))
......@@ -7429,17 +7435,29 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
pstmt.close();
pstmt = null;
// comment code for not deleting workorder
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( isDetailReq ) //added for supreme on 02/11/15 for delete both workorder
{
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();
}
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"))
......@@ -8764,7 +8782,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
boolean insertFlag = true; // added by cpatil for new req
ArrayList<String> tranIdList = new ArrayList<String>();
try
{
System.out.println("@@@@@@@@@cpatil:InsertPlanDemand called----winName["+winName+"] list["+list+"]--------");
......@@ -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+"]");
/*
/*
if( isDetailReq ) // added on 14/10/15 @supreme
{
if( "MPS".equals(orderType) && "S".equalsIgnoreCase(mpsOrder.mfgType))
......@@ -9057,112 +9075,112 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
System.out.println("@@@@@ insertFlag["+insertFlag+"]");
}
}
*/
// if(insertFlag)
// {
tranIdMpsOrder = getUniqueKey(xmlValues, mpsKeyStr, "tran_id", "W-MPS");
pstmtMpsOrder.setString(1, tranIdMpsOrder);
pstmtMpsOrder.setString(2, ordType);
pstmtMpsOrder.setString(3, itemCode);
pstmtMpsOrder.setString(4, siteCode);
pstmtMpsOrder.setDouble(5, quantity);
pstmtMpsOrder.setTimestamp(6, ordDate);
pstmtMpsOrder.setTimestamp(7, planDueDate);
pstmtMpsOrder.setString(8, mrpRunId);
pstmtMpsOrder.setString(9, addnOrder);
pstmtMpsOrder.setTimestamp(10, dueDate);
pstmtMpsOrder.setString(11, "M");//Manoj dtd 14/07/2014 Status Changed from P to M
pstmtMpsOrder.setTimestamp(12, statusDate);
pstmtMpsOrder.setDouble(13, yieldPerc);
pstmtMpsOrder.setString(14, routeCode);
pstmtMpsOrder.setString(15, bomCode);
pstmtMpsOrder.setString(16, projCode);
pstmtMpsOrder.setTimestamp(17, chgDate);
pstmtMpsOrder.setString(18, chgUser);
pstmtMpsOrder.setString(19, chgTerm);
pstmtMpsOrder.setString(20, unit);
pstmtMpsOrder.setString(21, acctCodeWp);
pstmtMpsOrder.setString(22, cctrCodeWp);
pstmtMpsOrder.setDouble(23, quantity);
pstmtMpsOrder.setString(24, unit);
pstmtMpsOrder.setDouble(25, quantity);
pstmtMpsOrder.setDouble(26, 1);
if (saleOrder != null && saleOrder.trim().length() > 0)
{
pstmtMpsOrder.setString(27, saleOrder);
} else
{
pstmtMpsOrder.setNull(27, java.sql.Types.CHAR);
}
if (lineNo != null && lineNo.trim().length() > 0)
{
pstmtMpsOrder.setString(28, lineNo);
} else
{
pstmtMpsOrder.setNull(28, java.sql.Types.CHAR);
}
*/
// if(insertFlag)
// {
tranIdMpsOrder = getUniqueKey(xmlValues, mpsKeyStr, "tran_id", "W-MPS");
pstmtMpsOrder.setString(1, tranIdMpsOrder);
pstmtMpsOrder.setString(2, ordType);
pstmtMpsOrder.setString(3, itemCode);
pstmtMpsOrder.setString(4, siteCode);
pstmtMpsOrder.setDouble(5, quantity);
pstmtMpsOrder.setTimestamp(6, ordDate);
pstmtMpsOrder.setTimestamp(7, planDueDate);
pstmtMpsOrder.setString(8, mrpRunId);
pstmtMpsOrder.setString(9, addnOrder);
pstmtMpsOrder.setTimestamp(10, dueDate);
pstmtMpsOrder.setString(11, "M");//Manoj dtd 14/07/2014 Status Changed from P to M
pstmtMpsOrder.setTimestamp(12, statusDate);
pstmtMpsOrder.setDouble(13, yieldPerc);
pstmtMpsOrder.setString(14, routeCode);
pstmtMpsOrder.setString(15, bomCode);
pstmtMpsOrder.setString(16, projCode);
pstmtMpsOrder.setTimestamp(17, chgDate);
pstmtMpsOrder.setString(18, chgUser);
pstmtMpsOrder.setString(19, chgTerm);
pstmtMpsOrder.setString(20, unit);
pstmtMpsOrder.setString(21, acctCodeWp);
pstmtMpsOrder.setString(22, cctrCodeWp);
pstmtMpsOrder.setDouble(23, quantity);
pstmtMpsOrder.setString(24, unit);
pstmtMpsOrder.setDouble(25, quantity);
pstmtMpsOrder.setDouble(26, 1);
if (saleOrder != null && saleOrder.trim().length() > 0)
{
pstmtMpsOrder.setString(27, saleOrder);
} else
{
pstmtMpsOrder.setNull(27, java.sql.Types.CHAR);
}
if (lineNo != null && lineNo.trim().length() > 0)
{
pstmtMpsOrder.setString(28, lineNo);
} else
{
pstmtMpsOrder.setNull(28, java.sql.Types.CHAR);
}
if( isDetailReq ) // added for supreme loc_group on 28/09/15
{
System.out.println("@@@@@final---locGroupMap["+locGroupMap+"]]");
String tempLocGroup="";
if( isDetailReq ) // added for supreme loc_group on 28/09/15
{
System.out.println("@@@@@final---locGroupMap["+locGroupMap+"]]");
String tempLocGroup="";
Set s1=locGroupMap.entrySet();
Iterator itr=s1.iterator();
while(itr.hasNext())
Set s1=locGroupMap.entrySet();
Iterator itr=s1.iterator();
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();
break;
}
String keyListStr = m.getKey().toString();
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.addBatch();
// **************pstmtMpsOrder.setDouble(25, demandQty);
pstmtMpsOrder.addBatch();
WOtranId = tranIdMpsOrder;
if( isDetailReq && tranIdMpsOrder!= null && tranIdMpsOrder.trim().length() > 0 && "S".equalsIgnoreCase(mpsOrder.mfgType))
{
System.out.println("tranIdMpsOrder["+tranIdMpsOrder+"]");
tranIdList.add(tranIdMpsOrder);
System.out.println("tranIdList["+tranIdList+"]");
}
WOtranId = tranIdMpsOrder;
if( isDetailReq && tranIdMpsOrder!= null && tranIdMpsOrder.trim().length() > 0 && "S".equalsIgnoreCase(mpsOrder.mfgType))
{
System.out.println("tranIdMpsOrder["+tranIdMpsOrder+"]");
tranIdList.add(tranIdMpsOrder);
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
{
String xtraParams="", windowName="mps_to_wo";
WorkorderPrc mpsToWorkOrder = new WorkorderPrc();
//errString = mpsToWorkOrder.process(xmlValues, xmlValues, windowName, xtraParams);
System.out.println("@@@@@@ tranIdList["+tranIdList+"]");
errString = mpsToWorkOrder.calWorkorderPrc( tranIdList, conn);
System.out.println("@@@@@@ errString["+errString+"]");
}*/
}
// System.out.println("Inserting mpsorder # " + count +
// " : " + tranIdMpsOrder);
......@@ -9524,9 +9542,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// Commented by Jiten 31/10/06 - error -null pointer Exception
// pstmtMpsOrder.clearParameters();
pstmtMpsOrder.close();
// End
// conn.commit();
......@@ -9548,8 +9566,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// pstmtIndDemand.clearParameters();//Commented by Jiten 14/11/06 as
// giving null pointer exception
pstmtIndDemand.close();
if( isDetailReq ) // add for mpsToWorkOrder on 14/10/15 @urse by cpatil
{
//String windowName="mps_to_wo";
......@@ -9559,12 +9577,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if( tranIdList.size() > 0)
{
//errString = mpsToWorkOrder.calWorkorderPrc( tranIdList, conn);
errString = mpsToWorkOrder.calWorkorderPrc( tranIdList, conn,xtraParams);
errString = mpsToWorkOrder.calWorkorderPrc( tranIdList, conn,xtraParams, true);
}
System.out.println("@@@@@@ errString["+errString+"]");
}
conn.commit();
// System.out.println("Rows Inserted in Work Order : [" + rowsInsertedWorkOrder.length + "]");
System.out.println("Rows Inserted in Mps Order : [" + rowsInsertedMpsOrder.length + "]");
......@@ -10064,6 +10082,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
for (int ctr3=0; ctr3 < IPD_MPS_ORDER.size();ctr3++)
{
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();
tempMap = (HashMap) IPD_MPS_ORDER.get(ctr3);
......@@ -10100,6 +10124,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
for (int ctr3=0; ctr3 < IPD_INDENT.size();ctr3++)
{
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();
tempMap = (HashMap) IPD_INDENT.get(ctr3);
......@@ -10132,6 +10162,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
for (int ctr3=0; ctr3 < IPD_DIST.size();ctr3++)
{
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();
tempMap = (HashMap) IPD_DIST.get(ctr3);
......@@ -10164,6 +10200,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
for (int ctr3=0; ctr3 < IPD_INDEPENDENT.size();ctr3++)
{
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();
tempMap = (HashMap) IPD_INDEPENDENT.get(ctr3);
......@@ -10978,6 +11020,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
System.out.println("@@@@@@@@@@@ inside dettimeCtr["+dettimeCtr+"]");
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");
String altItemPerc = detadpElement.getAltitemPerc();
......
......@@ -356,7 +356,9 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
CommonConstants commonConstants = new CommonConstants();
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
{
......@@ -537,7 +539,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
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,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 " +
" 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 " +
......@@ -557,10 +559,13 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
siteCode =rs2.getString("SITE_CODE");
quantityInv =rs2.getDouble("quantity");
issueQtyInv =rs2.getDouble("issue_qty");
String propReqQtyStr = df.format(propReqQty);
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);
System.out.println("@@@@lineNoInvAllocDet["+lineNoInvAllocDet+"]quantityInv["+quantityInv+"]");
String propReqQtyStr = df.format(quantityInv);
System.out.println("@@@@propReqQtyStr["+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 "
+" ,(a.quantity-a.alloc_qty) as stockBalQty "
......@@ -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) + ?"
+ " 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 exp_lev = ? ";
+ " and exp_lev = ? and line_no = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setDouble(1,propReqQty);
pstmt1.setDouble(2,propReqQty);
......@@ -834,6 +839,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
pstmt1.setString(7,siteCode);
pstmt1.setString(8,locCode);
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();
System.out.println("Count after PSTM is:- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%["+cnt+"]");
pstmt1.close();pstmt1=null;
......
......@@ -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
int count = 0,recIn=0 ;
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.setString(1,tranId);
pstmt.setString(2,itemCode);
......
......@@ -2727,7 +2727,7 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
}
return retVal;
}
@Override
public ArrayList getDetails(String woCode) throws ITMException
{
System.out.println("---getDetails method called12345-------------------");
......
......@@ -479,15 +479,16 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
public String calWorkorderPrc(ArrayList tranList,Connection conn) throws Exception,ITMException
{
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+"]");
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;
PreparedStatement pstmt = null,pstmtInsert=null,pstmtUpdate=null,pstmtSql1=null,pstmtSql2=null;
......@@ -510,6 +511,7 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
this.chgTerm = blanknull(this.chgTerm).trim();
}
System.out.println("[WorkorderPrc][calWorkorderPrc][loginCode]=>["+loginCode+"]this.loginCode["+this.loginCode+"]");
System.out.println("[WorkorderPrc][calWorkorderPrc][chgTerm]=>["+chgTerm+"]this.chgTerm ["+this.chgTerm +"]");
......@@ -730,7 +732,16 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
System.out.println("[WorkorderPrc]=>"+java.sql.Timestamp.valueOf(getCurrdateAppFormat().toString()));
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.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
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