Commit b268c39f authored by ngadkari's avatar ngadkari

New update reference and alloc reference column to update detail of stock...

New update reference and alloc reference column to update detail of stock allocation and deallocations

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@200040 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 64758d30
...@@ -1034,6 +1034,10 @@ public class DespatchConfirm extends ActionHandlerEJB implements DespatchConfirm ...@@ -1034,6 +1034,10 @@ public class DespatchConfirm extends ActionHandlerEJB implements DespatchConfirm
//System.out.println("updDesp nandu" +updDesp ); //System.out.println("updDesp nandu" +updDesp );
} }
//added by nandkumar gadkari on 22/04/19----------start----------------\
String logMsg= tranId +" "+expLev+" "+lineNo+ " "+"Deallocation of stock from DespatchConfirm";
updDesp.put("update_ref",logMsg);
//added by nandkumar gadkari on 22/04/19----------start----------------\
StockUpdate stckupd = new StockUpdate(); StockUpdate stckupd = new StockUpdate();
errString = stckupd.updateStock(updDesp, xtraParams, conn); errString = stckupd.updateStock(updDesp, xtraParams, conn);
//Added by Pavan R on 01aug18 [errString msg is returned from stock update, this message was ignored in a specific situation] //Added by Pavan R on 01aug18 [errString msg is returned from stock update, this message was ignored in a specific situation]
......
...@@ -495,6 +495,10 @@ public class DespatchPos extends ValidatorEJB implements DespatchPosLocal, Despa ...@@ -495,6 +495,10 @@ public class DespatchPos extends ValidatorEJB implements DespatchPosLocal, Despa
strAllocate.put("chg_win","W_DESPATCH"); strAllocate.put("chg_win","W_DESPATCH");
strAllocate.put("ref_ser","S-DSP"); strAllocate.put("ref_ser","S-DSP");
} }
//added by nandkumar gadkari on 17/04/19-------start=----------
String logMsg= tranId +" "+expLev+" "+line.substring(line.length()-3) + " "+"Allocation of stock from DespatchPos";
strAllocate.put("alloc_ref",logMsg);
//added by nandkumar gadkari on 17/04/19-------end=----------
//Calling DistStkUpdEJB //Calling DistStkUpdEJB
System.out.println("Calling DistStkUpdEJB....."); System.out.println("Calling DistStkUpdEJB.....");
/*if (distStkUpd.updAllocTrace(strAllocate, conn) > 0) /*if (distStkUpd.updAllocTrace(strAllocate, conn) > 0)
......
...@@ -414,6 +414,10 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa ...@@ -414,6 +414,10 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa
strAllocate.put("chg_win","W_DESPATCH"); strAllocate.put("chg_win","W_DESPATCH");
strAllocate.put("ref_ser","S-DSP"); strAllocate.put("ref_ser","S-DSP");
} }
//added by nandkumar gadkari on 17/04/19-------start=----------
String logMsg= tranId +" "+expLev+" "+line.substring(line.length()-3) + " "+"Deallocation of stock from DespatchPrs";
strAllocate.put("alloc_ref",logMsg);
//added by nandkumar gadkari on 17/04/19-------end=----------
//Calling DistStkUpdEJB //Calling DistStkUpdEJB
System.out.println("Calling DistStkUpdEJB....."); System.out.println("Calling DistStkUpdEJB.....");
/*if (distStkUpd.updAllocTrace(strAllocate, conn) > 0) /*if (distStkUpd.updAllocTrace(strAllocate, conn) > 0)
...@@ -586,6 +590,10 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa ...@@ -586,6 +590,10 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa
strAllocate.put("chg_win","W_DESPATCH"); strAllocate.put("chg_win","W_DESPATCH");
strAllocate.put("ref_ser","S-DSP"); strAllocate.put("ref_ser","S-DSP");
} }
//added by nandkumar gadkari on 17/04/19-------start=----------
String logMsg= tranId +" "+expLev+" "+line.substring(line.length()-3) + " "+"Deallocation of stock from DespatchPrs";
strAllocate.put("alloc_ref",logMsg);
//added by nandkumar gadkari on 17/04/19-------end=----------
//Calling DistStkUpdEJB //Calling DistStkUpdEJB
System.out.println("Calling DistStkUpdEJB....."); System.out.println("Calling DistStkUpdEJB.....");
/*if (distStkUpd.updAllocTrace(strAllocate, conn) > 0) /*if (distStkUpd.updAllocTrace(strAllocate, conn) > 0)
......
...@@ -13,7 +13,7 @@ import java.text.SimpleDateFormat; ...@@ -13,7 +13,7 @@ import java.text.SimpleDateFormat;
public class InvAllocTraceBean public class InvAllocTraceBean
{ {
FileWriter f = null; //FileWriter f = null;// commented all log writing by nandkumar gadkari on 19/04/19
/** /**
* Allocates/deallocates stock * Allocates/deallocates stock
* *
...@@ -24,19 +24,19 @@ public class InvAllocTraceBean ...@@ -24,19 +24,19 @@ public class InvAllocTraceBean
*/ */
public String updateInvallocTrace(HashMap invallocTraceMap, Connection conn) throws ITMException,Exception public String updateInvallocTrace(HashMap invallocTraceMap, Connection conn) throws ITMException,Exception
{ {
String fileDest = ""; //String fileDest = "";
double tempAllocQty = 0; double tempAllocQty = 0;
try try
{ {
//changes by gulzar on 12/12/2011 to write the log file in jboss log location //changes by gulzar on 12/12/2011 to write the log file in jboss log location
//f = new FileWriter("invalloc.log", true); //f = new FileWriter("invalloc.log", true);
fileDest = CommonConstants.JBOSSHOME + File.separator + "server" + File.separator + "default" + File.separator + "log" + File.separator + "invalloc.log"; // fileDest = CommonConstants.JBOSSHOME + File.separator + "server" + File.separator + "default" + File.separator + "log" + File.separator + "invalloc.log";
f = new FileWriter( fileDest, true); //f = new FileWriter( fileDest, true);
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
writeException(e, fileDest ); //writeException(e, fileDest );
} }
String errString = ""; String errString = "";
String errCode = "" ; String errCode = "" ;
...@@ -56,6 +56,9 @@ public class InvAllocTraceBean ...@@ -56,6 +56,9 @@ public class InvAllocTraceBean
String chgUser = (String)invallocTraceMap.get("chg_user"); String chgUser = (String)invallocTraceMap.get("chg_user");
String chgTerm = (String)invallocTraceMap.get("chg_term"); String chgTerm = (String)invallocTraceMap.get("chg_term");
String chgWin = (String)invallocTraceMap.get("chg_win"); String chgWin = (String)invallocTraceMap.get("chg_win");
//added by nandkumar gadkari on 17/04/19-------start=----------
String allocRef = (String)invallocTraceMap.get("alloc_ref") == null ? " " : (String)invallocTraceMap.get("alloc_ref") ;
//added by nandkumar gadkari on 17/04/19-------end=----------
if(lotNo == null) if(lotNo == null)
lotNo = " "; lotNo = " ";
if(lotSl == null) if(lotSl == null)
...@@ -154,7 +157,7 @@ public class InvAllocTraceBean ...@@ -154,7 +157,7 @@ public class InvAllocTraceBean
// end // end
f.write(keyString + " " + keyCol + " " + tranSer1+ "\r\n"); //f.write(keyString + " " + keyCol + " " + tranSer1+ "\r\n");
System.out.println("keyString :"+ keyString); System.out.println("keyString :"+ keyString);
System.out.println("keyCol :"+ keyCol); System.out.println("keyCol :"+ keyCol);
System.out.println("tranSer1 :"+ tranSer1); System.out.println("tranSer1 :"+ tranSer1);
...@@ -170,12 +173,12 @@ public class InvAllocTraceBean ...@@ -170,12 +173,12 @@ public class InvAllocTraceBean
System.out.println("xmlValues :["+xmlValues+"]"); System.out.println("xmlValues :["+xmlValues+"]");
TransIDGenerator tg = new TransIDGenerator(xmlValues, "BASE", commonConstants.DB_NAME); TransIDGenerator tg = new TransIDGenerator(xmlValues, "BASE", commonConstants.DB_NAME);
tranId = tg.generateTranSeqID(tranSer1, keyCol, keyString, conn); tranId = tg.generateTranSeqID(tranSer1, keyCol, keyString, conn);
f.write("trace tran id ... " +tranId + "\r\n"); // f.write("trace tran id ... " +tranId + "\r\n");
System.out.println("tranId :"+tranId); System.out.println("tranId :"+tranId);
sql = "INSERT INTO INVALLOC_TRACE (TRAN_ID, TRAN_DATE, REF_SER, REF_ID," sql = "INSERT INTO INVALLOC_TRACE (TRAN_ID, TRAN_DATE, REF_SER, REF_ID,"
+"REF_LINE,ITEM_CODE, SITE_CODE, LOC_CODE,LOT_NO, LOT_SL, ALLOC_QTY, CHG_WIN," +"REF_LINE,ITEM_CODE, SITE_CODE, LOC_CODE,LOT_NO, LOT_SL, ALLOC_QTY, CHG_WIN,"
+"CHG_USER, CHG_TERM, CHG_DATE )VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; +"CHG_USER, CHG_TERM, CHG_DATE ,ALLOC_REF )VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";//ALLOC_REF COLUMN ADDED BY NANDKUMAR GADKARI ON 17/04/19
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -194,7 +197,7 @@ public class InvAllocTraceBean ...@@ -194,7 +197,7 @@ public class InvAllocTraceBean
System.out.println("chgUser="+ chgUser); System.out.println("chgUser="+ chgUser);
System.out.println("chgTerm="+ chgTerm); System.out.println("chgTerm="+ chgTerm);
System.out.println("chgDate="+ chgDate); System.out.println("chgDate="+ chgDate);
f.write("trans id="+ tranId+"\n"); /*f.write("trans id="+ tranId+"\n");
f.write("tranDate="+ tranDate+"\n"); f.write("tranDate="+ tranDate+"\n");
f.write("refSer="+ refSer+"\n"); f.write("refSer="+ refSer+"\n");
f.write("refId="+ refId+"\n"); f.write("refId="+ refId+"\n");
...@@ -203,7 +206,7 @@ public class InvAllocTraceBean ...@@ -203,7 +206,7 @@ public class InvAllocTraceBean
f.write("locCode="+ locCode+"\n"); f.write("locCode="+ locCode+"\n");
f.write("lotNo="+ lotNo+"\n"); f.write("lotNo="+ lotNo+"\n");
f.write("lotSl="+ lotSl+"\n"); f.write("lotSl="+ lotSl+"\n");
f.write("ALLOC_QTY="+ allocQty+"\n"); f.write("ALLOC_QTY="+ allocQty+"\n");*/
...@@ -222,6 +225,7 @@ public class InvAllocTraceBean ...@@ -222,6 +225,7 @@ public class InvAllocTraceBean
pstmt.setString(13,chgUser); pstmt.setString(13,chgUser);
pstmt.setString(14,chgTerm); pstmt.setString(14,chgTerm);
pstmt.setDate(15,chgDate); pstmt.setDate(15,chgDate);
pstmt.setString(16,allocRef);//updateRef COLUMN ADDED BY NANDKUMAR GADKARI ON 17/04/19
pstmt.executeUpdate(); pstmt.executeUpdate();
//added by msalam on 281209 start //added by msalam on 281209 start
...@@ -232,7 +236,7 @@ public class InvAllocTraceBean ...@@ -232,7 +236,7 @@ public class InvAllocTraceBean
System.out.println("Allocate trace Updated..............................."); System.out.println("Allocate trace Updated...............................");
sqlUpdate = "UPDATE STOCK SET ALLOC_QTY =(CASE WHEN ALLOC_QTY IS NULL THEN 0 ELSE ALLOC_QTY END) + ? " sqlUpdate = "UPDATE STOCK SET ALLOC_QTY =(CASE WHEN ALLOC_QTY IS NULL THEN 0 ELSE ALLOC_QTY END) + ? ,ALLOC_REF='"+allocRef+"' "//updateRef column added by nandkumar gadkari on 17/04/19
+"WHERE ITEM_CODE = '"+itemCode+"' AND SITE_CODE = '"+ siteCode+"' AND LOC_CODE ='"+locCode+"' AND LOT_NO = '"+lotNo+"' AND LOT_SL = '"+lotSl+"'"; +"WHERE ITEM_CODE = '"+itemCode+"' AND SITE_CODE = '"+ siteCode+"' AND LOC_CODE ='"+locCode+"' AND LOT_NO = '"+lotNo+"' AND LOT_SL = '"+lotSl+"'";
pstmt = conn.prepareStatement(sqlUpdate); pstmt = conn.prepareStatement(sqlUpdate);
pstmt.setDouble(1,allocQty) ; pstmt.setDouble(1,allocQty) ;
...@@ -254,7 +258,7 @@ public class InvAllocTraceBean ...@@ -254,7 +258,7 @@ public class InvAllocTraceBean
System.out.println("Records updated "+ i); System.out.println("Records updated "+ i);
if(i>0) if(i>0)
{ {
f.write("sqlUpdate="+ sqlUpdate+"\n"+"Stock update success fully........................."+i+"\n"); //f.write("sqlUpdate="+ sqlUpdate+"\n"+"Stock update success fully........................."+i+"\n");
} }
else else
{ {
...@@ -263,13 +267,13 @@ public class InvAllocTraceBean ...@@ -263,13 +267,13 @@ public class InvAllocTraceBean
// } // }
System.out.println("Updated End.") ; System.out.println("Updated End.") ;
f.write("Updated End.........."); //f.write("Updated End..........");
} }
catch(SQLException e) catch(SQLException e)
{ {
f.write("TRANSATION ROLL BACK IN updateInvallocTrace"+"\n"); //f.write("TRANSATION ROLL BACK IN updateInvallocTrace"+"\n");
try{conn.rollback();}catch(Exception ee2){} try{conn.rollback();}catch(Exception ee2){}
writeException(e, fileDest); //writeException(e, fileDest);
System.out.println("SQLException :updateInvallocTrace : " + sqlUpdate + "\n" +e.getMessage()); System.out.println("SQLException :updateInvallocTrace : " + sqlUpdate + "\n" +e.getMessage());
System.out.println("ALLOC_QTY : " + allocQty); System.out.println("ALLOC_QTY : " + allocQty);
System.out.println("ITEM_CODE : " + itemCode); System.out.println("ITEM_CODE : " + itemCode);
...@@ -285,19 +289,19 @@ public class InvAllocTraceBean ...@@ -285,19 +289,19 @@ public class InvAllocTraceBean
} }
catch(Exception e) catch(Exception e)
{ {
writeException(e, fileDest); //writeException(e, fileDest);
System.out.println("Exception :updateInvallocTrace :" + sqlUpdate + "\n" +e.getMessage()); System.out.println("Exception :updateInvallocTrace :" + sqlUpdate + "\n" +e.getMessage());
errString = e.getMessage(); errString = e.getMessage();
e.printStackTrace(); e.printStackTrace();
try try
{ {
f.write("TRANSATION ROLL BACK IN updateInvallocTrace"+"\n"); //f.write("TRANSATION ROLL BACK IN updateInvallocTrace"+"\n");
try{conn.rollback();}catch(Exception ee2){} try{conn.rollback();}catch(Exception ee2){}
} }
catch(Exception e1) catch(Exception e1)
{ {
writeException(e, fileDest); //writeException(e, fileDest);
errString = e1.getMessage(); errString = e1.getMessage();
e = e1; e = e1;
} }
...@@ -308,7 +312,7 @@ public class InvAllocTraceBean ...@@ -308,7 +312,7 @@ public class InvAllocTraceBean
{ {
try try
{ {
f.close(); //f.close();
if(conn != null) if(conn != null)
{ {
if(pstmt != null) if(pstmt != null)
...@@ -327,10 +331,12 @@ public class InvAllocTraceBean ...@@ -327,10 +331,12 @@ public class InvAllocTraceBean
} }
catch(Exception e) catch(Exception e)
{ {
try{conn.rollback();f.write("TRANSATION ROLL BACK IN updateInvallocTrace"+"\n");}catch(Exception ee2){} try{conn.rollback();
//f.write("TRANSATION ROLL BACK IN updateInvallocTrace"+"\n");
}catch(Exception ee2){}
errString = e.getMessage(); errString = e.getMessage();
e.printStackTrace(); e.printStackTrace();
writeException(e, fileDest); //writeException(e, fileDest);
return errString; return errString;
} }
//return errString; //return errString;
...@@ -341,7 +347,7 @@ public class InvAllocTraceBean ...@@ -341,7 +347,7 @@ public class InvAllocTraceBean
{ {
try try
{ {
f.write(e.getMessage() + "\r\n"); //f.write(e.getMessage() + "\r\n");
//PrintStream t = new PrintStream(new FileOutputStream(new File("C:\\invalloc.log"),true)); //PrintStream t = new PrintStream(new FileOutputStream(new File("C:\\invalloc.log"),true));
PrintStream t = new PrintStream(new FileOutputStream(new File(fileDest),true)); PrintStream t = new PrintStream(new FileOutputStream(new File(fileDest),true));
e.printStackTrace(t); e.printStackTrace(t);
......
...@@ -1982,7 +1982,11 @@ public class PostOrdDespatchGen ...@@ -1982,7 +1982,11 @@ public class PostOrdDespatchGen
invAllocTraceMap.put("alloc_qty",(Double)sordDetMap.get("quantity__stduom") * -1); invAllocTraceMap.put("alloc_qty",(Double)sordDetMap.get("quantity__stduom") * -1);
invAllocTraceMap.put("chg_user",chgUser); invAllocTraceMap.put("chg_user",chgUser);
invAllocTraceMap.put("chg_term",chgTerm); invAllocTraceMap.put("chg_term",chgTerm);
invAllocTraceMap.put("chg_win","W_SORDER"); invAllocTraceMap.put("chg_win","W_SORDER");
//added by nandkumar gadkari on 17/04/19-------start=----------
String logMsg=checkNull(sordDetMap.get("sord_no").toString()) + " " + checkNull(sordDetMap.get("exp_lev").toString()) +" "+ checkNull(sordDetMap.get("line_no__sord").toString()) + " "+"Deallocation of stock from PostOrdDespatchGen";
invAllocTraceMap.put("alloc_ref",logMsg);
//added by nandkumar gadkari on 17/04/19-------end=----------
errString = invBean.updateInvallocTrace(invAllocTraceMap,conn); errString = invBean.updateInvallocTrace(invAllocTraceMap,conn);
System.out.println("deallocating......."); System.out.println("deallocating.......");
if(errString != null && errString.trim().length() > 0) if(errString != null && errString.trim().length() > 0)
...@@ -1991,6 +1995,33 @@ public class PostOrdDespatchGen ...@@ -1991,6 +1995,33 @@ public class PostOrdDespatchGen
return errString; return errString;
}else //Pavan R 10apr19[to deallocate in sordalloc and sorditem] start }else //Pavan R 10apr19[to deallocate in sordalloc and sorditem] start
{ {
//added by nandkumar gadkari on 17/04/19-------start=----------
String allocRef="";
sql = "select alloc_ref from stock where item_code= ? and site_code= ? and lot_no= ? and loc_code=? and lot_sl=? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,checkNull(sordDetMap.get("item_code").toString()));
pstmt.setString(2,siteCode);
pstmt.setString(3,checkNull(sordDetMap.get("lot_no").toString()));
pstmt.setString(4,checkNull(sordDetMap.get("loc_code").toString()));
pstmt.setString(5,checkNull(sordDetMap.get("lot_sl").toString()));
rs = pstmt.executeQuery();
if(rs.next())
{
allocRef = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("allocRef["+allocRef+"]");
System.out.println("allocReflog["+logMsg+"]");
if(!allocRef.equalsIgnoreCase(logMsg))
{
errString = itmDBAccessEJB.getErrorString("VTSTKNOAVL",errString,"","",conn);
return errString;
}
//added by nandkumar gadkari on 17/04/19-------end=----------
double qtyAlloc = 0; double qtyAlloc = 0;
double qtyStduom = (Double)sordDetMap.get("quantity__stduom"); double qtyStduom = (Double)sordDetMap.get("quantity__stduom");
int updateCnt = 0; int updateCnt = 0;
......
...@@ -1845,7 +1845,7 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -1845,7 +1845,7 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
double pendingDeallocQty=0.0,stockTot=0.0; double pendingDeallocQty=0.0,stockTot=0.0;
int updSordAllDetCnt=0; int updSordAllDetCnt=0;
String createLog=null,itemReasCode=""; String createLog=null,itemReasCode="";
String allocRef="";// added by nandkumar Gadkari on 17/04/19
try try
...@@ -3866,7 +3866,12 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -3866,7 +3866,12 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
invAllocTraceMap.put("alloc_qty",updQty); invAllocTraceMap.put("alloc_qty",updQty);
invAllocTraceMap.put("chg_user",userId); invAllocTraceMap.put("chg_user",userId);
invAllocTraceMap.put("chg_term",termId); invAllocTraceMap.put("chg_term",termId);
invAllocTraceMap.put("chg_win","W_SORDER"); invAllocTraceMap.put("chg_win","W_SORDER");
//added by nandkumar gadkari on 17/04/19-------start=----------
expLev = stockBean.getSordItemBean().getExpLev();
logMsg= saleOrder +" "+expLev+" "+lineNo + " "+"Allocation of stock from PostOrderProcess";
invAllocTraceMap.put("alloc_ref",logMsg);
//added by nandkumar gadkari on 17/04/19-------end=----------
merrcode = invBean.updateInvallocTrace(invAllocTraceMap,conn); merrcode = invBean.updateInvallocTrace(invAllocTraceMap,conn);
if(merrcode != null && merrcode.trim().length() > 0) if(merrcode != null && merrcode.trim().length() > 0)
{ {
...@@ -3875,7 +3880,33 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -3875,7 +3880,33 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
} }
else else
{ {
logMsg= saleOrder + "\t" + itemCode + "\t"+locCode + "\t" +lotNo+"\t"+ lineNo + "\tInserted data in INVALLOC_TRACE"; //added by nandkumar gadkari on 17/04/19-------start=----------
sql = "select alloc_ref from stock where item_code= ? and site_code= ? and lot_no= ? and loc_code=? and lot_sl=? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
pstmt.setString(2,siteCode);
pstmt.setString(3,lotNo);
pstmt.setString(4,locCode);
pstmt.setString(5,lotSl);
rs = pstmt.executeQuery();
if(rs.next())
{
allocRef = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("allocRef["+allocRef+"]");
System.out.println("allocReflog["+logMsg+"]");
if(!allocRef.equalsIgnoreCase(logMsg))
{
merrcode = itmDBAccessEJB.getErrorString("VTSTKNOAVL",merrcode,"","",conn);
return merrcode;
}
//added by nandkumar gadkari on 17/04/19-------end=----------
logMsg= saleOrder + "\t" + itemCode + "\t"+locCode + "\t" +lotNo+"\t"+ lineNo +"\t"+"Inserted data in INVALLOC_TRACE";
strToWrite=strToWrite+logMsg+"\t\r\n"; strToWrite=strToWrite+logMsg+"\t\r\n";
} }
//added by nandkumar gadkari on 24/01/19------------- end------------ //added by nandkumar gadkari on 24/01/19------------- end------------
...@@ -3917,7 +3948,11 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -3917,7 +3948,11 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
invAllocTraceMap.put("chg_term",termId); invAllocTraceMap.put("chg_term",termId);
invAllocTraceMap.put("chg_win","W_SORDER"); invAllocTraceMap.put("chg_win","W_SORDER");
//added by nandkumar gadkari on 17/04/19-------start=----------
expLev = stockBean.getSordItemBean().getExpLev();
logMsg= saleOrder +" "+expLev+" "+lineNo + " "+"Allocation for Stock from PostOrderProcess";
invAllocTraceMap.put("alloc_ref",logMsg);
//added by nandkumar gadkari on 17/04/19-------end=----------
merrcode = invBean.updateInvallocTrace(invAllocTraceMap,conn); merrcode = invBean.updateInvallocTrace(invAllocTraceMap,conn);
...@@ -3928,6 +3963,31 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -3928,6 +3963,31 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
} }
else else
{ {
//added by nandkumar gadkari on 17/04/19-------start=----------
sql = "select alloc_ref from stock where item_code= ? and site_code= ? and lot_no= ? and loc_code=? and lot_sl=? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
pstmt.setString(2,siteCode);
pstmt.setString(3,lotNo);
pstmt.setString(4,locCode);
pstmt.setString(5,lotSl);
rs = pstmt.executeQuery();
if(rs.next())
{
allocRef = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("allocRef["+allocRef+"]");
System.out.println("allocReflog["+logMsg+"]");
if(!allocRef.equalsIgnoreCase(logMsg))
{
merrcode = itmDBAccessEJB.getErrorString("VTSTKNOAVL",merrcode,"","",conn);
return merrcode;
}
//added by nandkumar gadkari on 17/04/19-------end=----------
logMsg= saleOrder + "\t" + itemCode + "\t"+locCode + "\t" +lotNo+"\t"+ lineNo + "\tInserted data in INVALLOC_TRACE"; logMsg= saleOrder + "\t" + itemCode + "\t"+locCode + "\t" +lotNo+"\t"+ lineNo + "\tInserted data in INVALLOC_TRACE";
strToWrite=strToWrite+logMsg+"\t\r\n"; strToWrite=strToWrite+logMsg+"\t\r\n";
} }
...@@ -4223,7 +4283,11 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -4223,7 +4283,11 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
invAllocTraceMap.put("chg_user",userId); invAllocTraceMap.put("chg_user",userId);
invAllocTraceMap.put("chg_term",termId); invAllocTraceMap.put("chg_term",termId);
invAllocTraceMap.put("chg_win","W_SORDER"); invAllocTraceMap.put("chg_win","W_SORDER");
//added by nandkumar gadkari on 17/04/19-------start=----------
expLev = stockBean.getSordItemBean().getExpLev();
logMsg= saleOrder +" "+expLev+" "+lineNo + " "+"Deallocation for Skip line from PostOrderProcess";
invAllocTraceMap.put("alloc_ref",logMsg);
//added by nandkumar gadkari on 17/04/19-------end=----------
merrcode = invBean.updateInvallocTrace(invAllocTraceMap,conn); merrcode = invBean.updateInvallocTrace(invAllocTraceMap,conn);
if(merrcode != null && merrcode.trim().length() > 0) if(merrcode != null && merrcode.trim().length() > 0)
{ {
...@@ -4232,6 +4296,31 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -4232,6 +4296,31 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
} }
else else
{ {
//added by nandkumar gadkari on 17/04/19-------start=----------
sql = "select alloc_ref from stock where item_code= ? and site_code= ? and lot_no= ? and loc_code=? and lot_sl=? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
pstmt.setString(2,siteCode);
pstmt.setString(3,lotNo);
pstmt.setString(4,locCode);
pstmt.setString(5,lotSl);
rs = pstmt.executeQuery();
if(rs.next())
{
allocRef = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("allocRef["+allocRef+"]");
System.out.println("allocReflog["+logMsg+"]");
if(!allocRef.equalsIgnoreCase(logMsg))
{
merrcode = itmDBAccessEJB.getErrorString("VTSTKNOAVL",merrcode,"","",conn);
return merrcode;
}
//added by nandkumar gadkari on 17/04/19-------end=----------
logMsg= saleOrder + "\t" + itemCode + "\t"+locCode + "\t" +lotNo+"\t"+ lineNo + "\tInserted data in INVALLOC_TRACE"; logMsg= saleOrder + "\t" + itemCode + "\t"+locCode + "\t" +lotNo+"\t"+ lineNo + "\tInserted data in INVALLOC_TRACE";
strToWrite=strToWrite+logMsg+"\t\r\n"; strToWrite=strToWrite+logMsg+"\t\r\n";
} }
......
...@@ -52,6 +52,7 @@ public class StockUpdate ...@@ -52,6 +52,7 @@ public class StockUpdate
String quarLockCode="",genratedTranId=""; String quarLockCode="",genratedTranId="";
String holdLock="";//addad by priyanka String holdLock="";//addad by priyanka
DistCommon distCommon = new DistCommon();// added by priyanka DistCommon distCommon = new DistCommon();// added by priyanka
String updateRef="";//added by nandkumar gadkari on 22/04/19
/** /**
* Updates stock return error if fails * Updates stock return error if fails
...@@ -1294,6 +1295,10 @@ public class StockUpdate ...@@ -1294,6 +1295,10 @@ public class StockUpdate
invAllocTraceMap.put("chg_user",userId); invAllocTraceMap.put("chg_user",userId);
invAllocTraceMap.put("chg_term",termId); invAllocTraceMap.put("chg_term",termId);
invAllocTraceMap.put("chg_win"," "); invAllocTraceMap.put("chg_win"," ");
//added by nandkumar gadkari on 17/04/19-------start=----------
String logMsg= this.tranId +" "+this.lineNo + " "+"Deallocation of stock";
invAllocTraceMap.put("alloc_ref",logMsg);
//added by nandkumar gadkari on 17/04/19-------end=----------
InvAllocTraceBean invBean = new InvAllocTraceBean(); InvAllocTraceBean invBean = new InvAllocTraceBean();
errString = invBean.updateInvallocTrace(invAllocTraceMap,conn); errString = invBean.updateInvallocTrace(invAllocTraceMap,conn);
...@@ -1310,7 +1315,10 @@ public class StockUpdate ...@@ -1310,7 +1315,10 @@ public class StockUpdate
+" chg_date = ?," +" chg_date = ?,"
+" gross_weight = (case when gross_weight is null then 0 else gross_weight end) - ?," +" gross_weight = (case when gross_weight is null then 0 else gross_weight end) - ?,"
+" net_weight = (case when net_weight is null then 0 else net_weight end) - ?," +" net_weight = (case when net_weight is null then 0 else net_weight end) - ?,"
+" tare_weight = (case when tare_weight is null then 0 else tare_weight end) - ? " +" tare_weight = (case when tare_weight is null then 0 else tare_weight end) - ? ,"
//added by nandkumar gadkari on 22/04/19--------start------------
+" update_ref = '"+this.updateRef+"'"
//added by nandkumar gadkari on 22/04/19--------end------------
+" where item_code = '"+this.itemCode+"'" +" where item_code = '"+this.itemCode+"'"
+"and site_code = '"+this.siteCode +"'" +"and site_code = '"+this.siteCode +"'"
+"and loc_code = '"+this.locationCode +"'" +"and loc_code = '"+this.locationCode +"'"
...@@ -2319,7 +2327,12 @@ public class StockUpdate ...@@ -2319,7 +2327,12 @@ public class StockUpdate
this.holdQty = Double.parseDouble(updateStockMap.get("hold_qty").toString()); this.holdQty = Double.parseDouble(updateStockMap.get("hold_qty").toString());
} }
//added by saurabh to set hold qty[25/10/16|End] //added by saurabh to set hold qty[25/10/16|End]
//added by nandkumar gadkari on 22/04/19--------start------------
if(updateStockMap.get("update_ref")!= null)
{
this.updateRef = updateStockMap.get("update_ref").toString();
}
//added by nandkumar gadkari on 22/04/19--------start------------
}catch(Exception e){ }catch(Exception e){
System.out.println("Exception "+e); System.out.println("Exception "+e);
e.printStackTrace(); e.printStackTrace();
......
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