Commit c6f36746 authored by cpatil's avatar cpatil

modified at urse


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98812 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6af8c6f1
...@@ -88,6 +88,7 @@ public class MrpWizPrsSaveBean ...@@ -88,6 +88,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>();
try try
{ {
...@@ -308,6 +309,20 @@ public class MrpWizPrsSaveBean ...@@ -308,6 +309,20 @@ 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);
System.out.println("@@@@ detail4DataInfo["+detail4DataInfo+"]detail4DataInfoList["+detail4DataInfoList+"]");
if(detail4DataInfoList.contains(detail4DataInfo))
{
System.out.println("same allocation repeate.........continue.......");
continue;
}
else
{
System.out.println("new allocation ................");
detail4DataInfoList.add(detail4DataInfo);
}
System.out.println("@@@@@@@@ testing purpose SOP....detail4DataInfoList["+detail4DataInfoList+"].");
String itemCodeHdr=""; String itemCodeHdr="";
remarks = "From mrp process"; remarks = "From mrp process";
...@@ -345,9 +360,10 @@ public class MrpWizPrsSaveBean ...@@ -345,9 +360,10 @@ public class MrpWizPrsSaveBean
} }
System.out.println("@@@@@::: sorder ["+tempSO+"]tempLineNo["+tempLineNo+"] updated next i["+i+"]...."); System.out.println("@@@@@::: sorder ["+tempSO+"]tempLineNo["+tempLineNo+"] updated next i["+i+"]....");
} }
if( tempSO != null && tempSO.trim().length() > 0 ) if( tempSO != null && tempSO.trim().length() > 0 && tempLineNo != null && tempLineNo.trim().length() > 0 )
{ {
sql1=" select work_order from workorder where sale_order = ? AND site_code = ? "; System.out.println("@@@@@::test: sorder ["+tempSO+"]tempLineNo["+tempLineNo+"]");
/*sql1=" select work_order from workorder where sale_order = ? AND site_code = ? ";
pstmt1=conn.prepareStatement(sql1); pstmt1=conn.prepareStatement(sql1);
pstmt1.setString(1,tempSO); pstmt1.setString(1,tempSO);
pstmt1.setString(2,siteCode); pstmt1.setString(2,siteCode);
...@@ -378,6 +394,79 @@ public class MrpWizPrsSaveBean ...@@ -378,6 +394,79 @@ public class MrpWizPrsSaveBean
pstmt1=null; pstmt1=null;
System.out.println("@@@@@ 2 refWorkOrder ["+refWorkOrder+"]"); System.out.println("@@@@@ 2 refWorkOrder ["+refWorkOrder+"]");
}*/
int SOCnt=0,MPSCnt=0;
sql1=" select count(1) from sorder where sale_order = ? ";
pstmt1=conn.prepareStatement(sql1);
pstmt1.setString(1,tempSO);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
SOCnt = rs1.getInt(1);
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null;
System.out.println("@@@@@398:tempSO["+tempSO+"]SOCnt["+SOCnt+"]");
if( SOCnt == 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())
{
MPSCnt = rs1.getInt(1);
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null;
}
System.out.println("@@@@@413:tempSO["+tempSO+"]SOCnt["+SOCnt+"]MPSCnt["+MPSCnt+"]");
if( SOCnt > 0)
{
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 ";
pstmt1=conn.prepareStatement(sql1);
pstmt1.setString(1,tempSO);
pstmt1.setString(2,tempLineNo);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
refWorkOrder = rs1.getString("work_order");
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null;
System.out.println("@@@@@ 1 refWorkOrder from sorder["+tempSO+"] to mps to WO["+refWorkOrder+"]");
}
if( MPSCnt > 0 && ( refWorkOrder == null || refWorkOrder.trim().length() == 0 ) )
{
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 ";
pstmt1=conn.prepareStatement(sql1);
pstmt1.setString(1,tempSO);
pstmt1.setString(2,tempLineNo);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
refWorkOrder = rs1.getString("work_order");
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null;
//System.out.println("@@@@@ 2 refWorkOrder ["+refWorkOrder+"]");
System.out.println("@@@@@ 1 refWorkOrder from MPS["+tempSO+"] to WO["+refWorkOrder+"]");
} }
} }
...@@ -420,7 +509,7 @@ public class MrpWizPrsSaveBean ...@@ -420,7 +509,7 @@ public class MrpWizPrsSaveBean
if (errString != null && errString.trim().length() > 0) if (errString != null && errString.trim().length() > 0)
{ {
System.out.println("@@@@@@rolledback errString :::"+ errString ); System.out.println("@@@@@@rolledback stockAllocationPrc.updateInvallocTrace errString :::"+ errString );
conn.rollback(); conn.rollback();
return errString; return errString;
} }
...@@ -508,7 +597,7 @@ public class MrpWizPrsSaveBean ...@@ -508,7 +597,7 @@ public class MrpWizPrsSaveBean
hashMap.put("chg_user",chgUser); hashMap.put("chg_user",chgUser);
hashMap.put("chg_term",chgTerm); hashMap.put("chg_term",chgTerm);
hashMap.put("chg_date", date ); hashMap.put("chg_date", date );
System.out.println("CALLING updateInvallocTrace() --"); System.out.println("CALLING updateInvallocTrace() -hashMap["+hashMap+"]");
invAllocTrace = new InvAllocTraceBean(); invAllocTrace = new InvAllocTraceBean();
errString = invAllocTrace.updateInvallocTrace(hashMap, conn); errString = invAllocTrace.updateInvallocTrace(hashMap, conn);
System.out.println("updateInvallocTrace 1....."+errString); System.out.println("updateInvallocTrace 1....."+errString);
...@@ -874,6 +963,15 @@ public class MrpWizPrsSaveBean ...@@ -874,6 +963,15 @@ public class MrpWizPrsSaveBean
return ""; return "";
} }
private String checkNull(String input)
{
if(input == null)
{
input = "";
}
return input;
}
private String generateTranId( String windowName, String siteCode, Connection conn )throws ITMException private String generateTranId( String windowName, String siteCode, Connection conn )throws ITMException
{ {
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
......
...@@ -539,7 +539,9 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz ...@@ -539,7 +539,9 @@ public class RunMRPWiz extends ValidatorEJB implements RunMRPWizLocal, RunMRPWiz
//" and case when sorder.alloc_flag is null then 'N' else sorder.alloc_flag end <> 'Y' " + //" and case when sorder.alloc_flag is null then 'N' else sorder.alloc_flag end <> 'Y' " +
" and case when sorditem.alloc_flag is null then 'N' else sorditem.alloc_flag end <> 'Y' " + " and case when sorditem.alloc_flag is null then 'N' else sorditem.alloc_flag end <> 'Y' " +
" and ( siteitem.item_code = item.item_code ) and ( siteitem.site_code = sorditem.site_code )" + " and ( siteitem.item_code = item.item_code ) and ( siteitem.site_code = sorditem.site_code )" +
" and (select count(1) from mps_order where mps_order.sale_order = sorder.sale_order and siteitem.mfg_type = 'S') = 0" ; // " and (select count(1) from mps_order where mps_order.sale_order = sorder.sale_order and siteitem.mfg_type = 'S') = 0 " +
" and (select count(1) from mps_order where mps_order.sale_order = sorder.sale_order and " +
" sorder.sale_order = sorditem.sale_order and sorditem.alloc_flag='N' and siteitem.mfg_type = 'S' ) = 0 " ;
if("order_date".equalsIgnoreCase(viewByDate)) if("order_date".equalsIgnoreCase(viewByDate))
{ {
......
...@@ -1443,7 +1443,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1443,7 +1443,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
" from inv_alloc_det where tran_id IN (SELECT TRAN_ID FROM INV_ALLOCATE "+ " from inv_alloc_det where tran_id IN (SELECT TRAN_ID FROM INV_ALLOCATE "+
" WHERE WORK_ORDER IN (SELECT WORK_ORDER FROM WORKORDER WHERE CAMPGN_NO = ? AND STATUS = 'R')) "+ " WHERE WORK_ORDER IN (SELECT WORK_ORDER FROM WORKORDER WHERE CAMPGN_NO = ? AND STATUS = 'R')) "+
" and loc_code in(select loc_code from location where inv_stat in("+invstat1Str+") ) and site_code = ? and item_code= ? " // change invstat1 to invstat1Str for multiple loc code on 22/09/15 by cpatil " and loc_code in(select loc_code from location where inv_stat in("+invstat1Str+") ) and site_code = ? and item_code= ? " // change invstat1 to invstat1Str for multiple loc code on 22/09/15 by cpatil
+ "and case when deallocated is null then 'N' else deallocated end = 'N' and lot_no=? and lot_sl=? and loc_code=? "; + " and case when deallocated is null then 'N' else deallocated end = 'N' and lot_no=? and lot_sl=? and loc_code=? "
+ " and (case when alloc_qty is null then 0 else alloc_qty end) <> (case when dealloc_qty is null then 0 else dealloc_qty end) "; // add this condition to remove triger error for update dealloc quaantity repeat from stock @urse 19/10/15
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setString(1,campNo); pstmt.setString(1,campNo);
...@@ -1475,7 +1476,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1475,7 +1476,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
hashMap.put("chg_term", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "termId")); hashMap.put("chg_term", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "termId"));
hashMap.put("loc_code__fr",rs.getString("loc_code")); hashMap.put("loc_code__fr",rs.getString("loc_code"));
hashMap.put("exp_lev",rs.getString("exp_lev")); hashMap.put("exp_lev",rs.getString("exp_lev"));
System.out.println("Calling DistStkUpdEJB....."+ddlg); System.out.println("Calling DistStkUpdEJB.....["+ddlg+"]hashMap["+hashMap+"]");
if (distStkUpd.updAllocTrace(hashMap, connOne) > 0) if (distStkUpd.updAllocTrace(hashMap, connOne) > 0)
{ {
System.out.println("distStkUpd.UpdAllocTrace(HashMap, Connection) : Sucessuful!"); System.out.println("distStkUpd.UpdAllocTrace(HashMap, Connection) : Sucessuful!");
......
...@@ -476,11 +476,45 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko ...@@ -476,11 +476,45 @@ public class WorkorderPrc extends ProcessEJB implements WorkorderPrcLocal,Worko
return errString; return errString;
}//END OF PROCESS(2) }//END OF PROCESS(2)
private String calWorkorderPrc(ArrayList tranList,Connection conn) throws Exception,ITMException public String calWorkorderPrc(ArrayList tranList,Connection conn) throws Exception,ITMException
{ {
String errString="", xtraParams="";
errString=calWorkorderPrc(tranList,conn,xtraParams);
System.out.println("calWorkorderPrc(tranList,conn,xtraParams)@@@errString["+errString+"]");
return errString;
}
public String calWorkorderPrc(ArrayList tranList,Connection conn, String xtraParams) throws Exception,ITMException
{
System.out.println("@@@@@@@@@@@ calWorkorderPrc()............");
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;
if( this.conn==null)
{
System.out.println("@@@@@@@@@ conn null found...........");
this.conn = conn;
System.out.println("@@@@@@@@@ existing conn assign this.conn..........");
}
if( this.loginCode == null )
{
this.loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
this.loginCode = blanknull(this.loginCode).trim();
}
if( this.chgTerm == null )
{
this.chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId");
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 +"]");
int i=0; int i=0;
double quantity=0.0; double quantity=0.0;
double yieldPerc=0.0; double yieldPerc=0.0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment