Commit 4acd74b9 authored by prane's avatar prane

to update demand and supply in inv_dem_supp table for mrp summary data by calling common component.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@215357 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b48e4107
......@@ -5,6 +5,7 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
......@@ -19,6 +20,7 @@ import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ProcessEJB;
import ibase.webitm.ejb.mfg.InvDemSuppTraceBean;
import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.TransIDGenerator;
......@@ -634,6 +636,8 @@ public class BuildForecastPrc extends ProcessEJB
String period1="",period2="",period3="";
try
{
InvDemSuppTraceBean invDemSupTrcBean = new InvDemSuppTraceBean();
HashMap demandSupplyMap = new HashMap();
String userid = getUserInfo().getLoginCode();
String termid = getUserInfo().getLoginCode();
float lc_quantity = 0, lc_perc = 1, qty = 0;
......@@ -823,6 +827,40 @@ public class BuildForecastPrc extends ProcessEJB
e.printStackTrace();
}
}
/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
Timestamp dueDate = null;
sql = "select fr_date from period where code = ?";
pstm = conn.prepareStatement(sql);
pstm.setString(1, forecastBean.getCurrperiod());
rs = pstm.executeQuery();
if( rs.next() )
{
dueDate = rs.getTimestamp("fr_date");
}
rs.close();
rs = null;
pstm.close();
pstm = null;
demandSupplyMap.put("site_code", siteCode);
demandSupplyMap.put("item_code", itemCode);
demandSupplyMap.put("ref_ser", "S-FST");
demandSupplyMap.put("ref_id", tranId);
demandSupplyMap.put("ref_line", "NA");
demandSupplyMap.put("due_date", dueDate);
demandSupplyMap.put("demand_qty", (double)lc_quantity);
demandSupplyMap.put("supply_qty", 0.0);
demandSupplyMap.put("change_type", "A");
demandSupplyMap.put("chg_process", "T");
demandSupplyMap.put("chg_user", userid);
demandSupplyMap.put("chg_term", termid);
retString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn);
demandSupplyMap.clear();
if(retString != null && retString.trim().length() > 0)
{
System.out.println("retString["+retString+"]");
return retString;
}
/**Added by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
}
BaseLogger.log( "3", getUserInfo(), null, "hdrInsCont ; ["+ hdrInsCont +"], detInsCont : ["+ detInsCont +"]" );
}
......
......@@ -11,6 +11,7 @@ import java.rmi.RemoteException;
import java.text.SimpleDateFormat;
import ibase.webitm.ejb.*;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.ejb.mfg.InvDemSuppTraceBean;
import ibase.webitm.utility.*;
import ibase.system.config.*;
import ibase.utility.CommonConstants;
......@@ -85,7 +86,8 @@ public class DemandGenPrc extends ProcessEJB implements DemandGenPrcLocal, Deman
conn.setAutoCommit(false);
fromDT = genericUtility.getColumnValue("from_date", Dom);
toDT = genericUtility.getColumnValue("to_date", Dom);
InvDemSuppTraceBean invDemSupTrcBean = new InvDemSuppTraceBean();
HashMap demandSupplyMap = new HashMap();
// custCode=genericUtility.getColumnValue("cust_code",Dom);
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
loginSite = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
......@@ -255,6 +257,36 @@ public class DemandGenPrc extends ProcessEJB implements DemandGenPrcLocal, Deman
System.out.println("xmlString::" + xmlString);
retString = saveData(loginSite, xmlString, userId, conn);
/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
if (retString.indexOf("Success") > -1)
{
String[] arrayForTranIdIssue = retString.split("<TranID>");
int endIndexIssue = arrayForTranIdIssue[1].indexOf("</TranID>");
String transId = arrayForTranIdIssue[1].substring(0, endIndexIssue);
System.out.println("@V@ Tran id :- [" + transId + "]");
demandSupplyMap.put("site_code", keyData[0]);
demandSupplyMap.put("item_code", keyData[1]);
demandSupplyMap.put("ref_ser", "I-DEM");
demandSupplyMap.put("ref_id", transId);
demandSupplyMap.put("ref_line", "NA");
demandSupplyMap.put("due_date", dueDateTimestmp);
demandSupplyMap.put("demand_qty", indDemandrow.get(eachIndDemand));
demandSupplyMap.put("supply_qty", 0.0);
demandSupplyMap.put("change_type", "A");
demandSupplyMap.put("chg_process", "T");
demandSupplyMap.put("chg_user", genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode"));
demandSupplyMap.put("chg_term", genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId"));
errString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn);
demandSupplyMap.clear();
if(errString != null && errString.trim().length() > 0)
{
System.out.println("errString["+errString+"]");
return errString;
}
}
/**Added by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
} else {
qtyStdUom1 = distCommon.getConvQuantityFact(unit, unitStd, keyData[1], indDemandrow.get(eachIndDemand), convQtyStduom, conn);
qtyStdUom = Double.parseDouble((String) qtyStdUom1.get(1));
......@@ -266,6 +298,30 @@ public class DemandGenPrc extends ProcessEJB implements DemandGenPrcLocal, Deman
pstmt1.setString(3, tranID);
updcnt = pstmt1.executeUpdate();
System.out.println("updcnt" + updcnt);
/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
if(updcnt > 0)
{
demandSupplyMap.put("site_code", keyData[0]);
demandSupplyMap.put("item_code", keyData[1]);
demandSupplyMap.put("ref_ser", "I-DEM");
demandSupplyMap.put("ref_id", tranID);
demandSupplyMap.put("ref_line", "1");
demandSupplyMap.put("due_date", dueDateTimestmp);
demandSupplyMap.put("demand_qty", qtyStdUom);
demandSupplyMap.put("supply_qty", 0.0);
demandSupplyMap.put("change_type", "C");
demandSupplyMap.put("chg_process", "T");
demandSupplyMap.put("chg_user", genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode"));
demandSupplyMap.put("chg_term", genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId"));
errString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn);
demandSupplyMap.clear();
if(errString != null && errString.trim().length() > 0)
{
System.out.println("errString["+errString+"]");
return errString;
}
}
/**Added by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
}
......
......@@ -8,6 +8,7 @@ import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.fin.FinCommonInvAcct;
import ibase.webitm.ejb.fin.InvAcct;
import ibase.webitm.ejb.mfg.InvDemSuppTraceBean;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.TransIDGenerator;
......@@ -236,6 +237,10 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
String lotSlIss ="";
String msgType= "";
int llCnt=0;
/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
Timestamp dueDateOrd = null;
String siteCodeDlv = "";
/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
String confirmed="",confPasswd="",lsPwdVerified="",sql1="",lsLedgPostConf="",loginEmpCode="",saleOrder="",lineNoSord="",itemCodeOrd="",expLev="";
double ldQty=0.00,ldBalQty=0.00,qtytoballocated=0.00,qtyAlloc=0.00,lcAllocatedqty=0.00;
boolean lbAllocated=false,isError=false;
......@@ -253,7 +258,8 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
System.out.println("@V@ loginEmpCode :- ["+loginEmpCode+"]");
InvDemSuppTraceBean invDemSupTrcBean = new InvDemSuppTraceBean();
HashMap demandSupplyMap = new HashMap();
//Added by sarita to get Current Date with time[00:00:00.0] on 12 JUN 18 [START]
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
java.util.Date currentDate = new java.util.Date();
......@@ -1617,6 +1623,43 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
upd = pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
sql = "select b.due_date, a.site_code__dlv from distorder a, distorder_det b"
+ " where a.dist_order = b.dist_order"
+ " and a.dist_order = ?"
+ " and b.line_no = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,distOrder);
pstmt1.setInt(2,lineNoDistOrder);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
dueDateOrd = rs1.getTimestamp("due_date"); // to populate due_date and site_code
siteCodeDlv = rs1.getString("site_code__dlv");
}
pstmt1.close();
pstmt1 = null;
demandSupplyMap.put("site_code", siteCodeDlv);
demandSupplyMap.put("item_code", itemCode);
demandSupplyMap.put("ref_ser", "D-ORDR");
demandSupplyMap.put("ref_id", distOrder);
demandSupplyMap.put("ref_line", ""+lineNoDistOrder);
demandSupplyMap.put("due_date", dueDateOrd);
demandSupplyMap.put("demand_qty", 0.0);
demandSupplyMap.put("supply_qty", quantity *(-1));
demandSupplyMap.put("change_type", "C");
demandSupplyMap.put("chg_process", "T");
demandSupplyMap.put("chg_user", genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode"));
demandSupplyMap.put("chg_term", genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId"));
errString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn);
if(errString != null && errString.trim().length() > 0)
{
System.out.println("errString["+errString+"]");
return errString;
}
/**Added by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
}
}
rs.close();
......
......@@ -23,6 +23,9 @@ import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import ibase.webitm.ejb.mfg.InvDemSuppTraceBean;
import java.sql.Timestamp;
import javax.ejb.Stateless;
......@@ -665,7 +668,14 @@ public class IndentConf extends ActionHandlerEJB implements IndentConfLocal, Ind
String sql = "", sql1 = "", ls_errcode = "", ecode = "", ls_task_code = "", ls_item_code = "", ls_proj_code = "", ls_indtype = "",
ls_specific_instr = "", ls_act_code = "", ls_fl_id = "", ls_conf_unit = "", ls_ind_type = "", ls_type_allow_projbudgt_list = "",
ls_old_indno = "", currDate = "";
int cnt = 0, lc_ind_qty = 0, lc_porder_qty = 0, lc_indent_qty = 0, lc_total_qty = 0, lc_proj_est_qty = 0;
/**Modified by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
int cnt = 0;// lc_ind_qty = 0, lc_porder_qty = 0, lc_indent_qty = 0, lc_total_qty = 0, lc_proj_est_qty = 0;
double lc_ind_qty = 0, lc_porder_qty = 0, lc_indent_qty = 0, lc_total_qty = 0, lc_proj_est_qty = 0;
String siteCode = "";
Timestamp reqDate = null;
HashMap demandSupplyMap = null;
InvDemSuppTraceBean invDemSupTrcBean = null;
/**Modified by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
double mrate = 0.0, mmax_rate = 0.0, lc_tot_poamt = 0.0, lc_po_amt1 = 0.0, lc_porcp_amt = 0.0, lc_pret_amt = 0.0, lc_tot_poamt11 = 0.0,
lc_po_amt12 = 0.0, lc_porcp_amt11 = 0.0, lc_pret_amt11 = 0.0, lc_tot_amt_proj = 0.0, lc_tot_amt = 0.0, lc_ind_amount = 0.0,
lc_approxcost = 0.0, lc_exceed_amt = 0.0;
......@@ -693,8 +703,11 @@ public class IndentConf extends ActionHandlerEJB implements IndentConfLocal, Ind
rs.close();
rs = null;
}
sql = "SELECT TASK_CODE, ITEM_CODE, QUANTITY, PROJ_CODE, IND_TYPE, SPECIFIC_INSTR FROM INDENT WHERE IND_NO = ? AND STATUS = ? ";
/**Modified by Pavan Rane 24dec19 start[to get qty in double instead of integer as to be update demand/supply in summary table(RunMRP process) related changes]*/
invDemSupTrcBean = new InvDemSuppTraceBean();
demandSupplyMap = new HashMap();
//sql = "SELECT TASK_CODE, ITEM_CODE, QUANTITY, PROJ_CODE, IND_TYPE, SPECIFIC_INSTR FROM INDENT WHERE IND_NO = ? AND STATUS = ? ";
sql = "SELECT TASK_CODE, ITEM_CODE, QUANTITY, PROJ_CODE, IND_TYPE, SPECIFIC_INSTR, SITE_CODE, REQ_DATE FROM INDENT WHERE IND_NO = ? AND STATUS = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
pstmt.setString(2, "U");
......@@ -703,10 +716,15 @@ public class IndentConf extends ActionHandlerEJB implements IndentConfLocal, Ind
{
ls_task_code = checkNullAndTrim(rs.getString("TASK_CODE"));
ls_item_code = checkNullAndTrim(rs.getString("ITEM_CODE"));
lc_ind_qty = rs.getInt("QUANTITY");
//lc_ind_qty = rs.getInt("QUANTITY");
lc_ind_qty = rs.getDouble("QUANTITY");
ls_proj_code = checkNullAndTrim(rs.getString("PROJ_CODE"));
ls_indtype = checkNullAndTrim(rs.getString("IND_TYPE"));
ls_specific_instr = checkNullAndTrim(rs.getString("SPECIFIC_INSTR"));
siteCode = checkNullAndTrim(rs.getString("SITE_CODE"));
reqDate = rs.getTimestamp("REQ_DATE");
/**Modified by Pavan Rane 24dec19 end[to get qty in double instead of integer as to be update demand/supply in summary table(RunMRP process) related changes]*/
}
if(pstmt != null)
{
......@@ -730,7 +748,9 @@ public class IndentConf extends ActionHandlerEJB implements IndentConfLocal, Ind
rs = pstmt.executeQuery();
if(rs.next())
{
lc_porder_qty = rs.getInt(1);
//lc_porder_qty = rs.getInt(1);/**Modified by Pavan Rane 24dec19 [to get qty in double instead of integer as to be update demand/supply in summary table(RunMRP process) related changes]*/
lc_porder_qty = rs.getDouble(1);
}
if(pstmt != null)
{
......@@ -751,7 +771,8 @@ public class IndentConf extends ActionHandlerEJB implements IndentConfLocal, Ind
rs = pstmt.executeQuery();
if(rs.next())
{
lc_indent_qty = rs.getInt(1);
//lc_indent_qty = rs.getInt(1);/**Modified by Pavan Rane 24dec19 start[to get qty in double instead of integer as to be update demand/supply in summary table(RunMRP process) related changes]*/
lc_indent_qty = rs.getDouble(1);
}
if(pstmt != null)
{
......@@ -773,7 +794,8 @@ public class IndentConf extends ActionHandlerEJB implements IndentConfLocal, Ind
rs = pstmt.executeQuery();
if(rs.next())
{
lc_proj_est_qty = rs.getInt(1);
//lc_proj_est_qty = rs.getInt(1);/**Modified by Pavan Rane 24dec19 start[to get qty in double instead of integer as to be update demand/supply in summary table(RunMRP process) related changes]*/
lc_proj_est_qty = rs.getDouble(1);
}
if(pstmt != null)
{
......@@ -1172,6 +1194,26 @@ public class IndentConf extends ActionHandlerEJB implements IndentConfLocal, Ind
if(cnt > 0)
{
/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
demandSupplyMap.put("site_code", siteCode);
demandSupplyMap.put("item_code", ls_item_code);
demandSupplyMap.put("ref_ser", "IND");
demandSupplyMap.put("ref_id", tranId);
demandSupplyMap.put("ref_line", "NA");
demandSupplyMap.put("due_date", reqDate);
demandSupplyMap.put("demand_qty", 0.0);
demandSupplyMap.put("supply_qty", lc_ind_qty);
demandSupplyMap.put("change_type", "A");
demandSupplyMap.put("chg_process", "T");
demandSupplyMap.put("chg_user", genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode"));
demandSupplyMap.put("chg_term", genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId"));
ls_errcode = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn);
if(ls_errcode != null && ls_errcode.trim().length() > 0)
{
System.out.println("errString["+ls_errcode+"]");
return "VTDEMSUPER";
}
/**Added by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
String ediOption = "";
String dataStr = "";
sql = "SELECT EDI_OPTION FROM TRANSETUP WHERE TRAN_WINDOW = 'w_indent' ";
......
......@@ -8,6 +8,7 @@ import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.*;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.mfg.InvDemSuppTraceBean;
//import ibase.webitm.ejb.dis_exp.PurcOrderAmdTWFInvokeConfirm;
import ibase.webitm.ejb.sys.CreateRCPXML;
import org.w3c.dom.*;
......@@ -311,7 +312,11 @@ public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLoca
}
}
errCode = ConfirmPordAmd(amdNo, conn);
/**Modified by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]
[changed method signature to pass xtraParams to update login user and login terminal]*/
//errCode = ConfirmPordAmd(amdNo, conn);
errCode = ConfirmPordAmd(amdNo, xtraParams, conn);
/**Modified by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
if (errCode != null && errCode.trim().length() > 0)
{
......@@ -428,9 +433,10 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
return errCode;
}
public String ConfirmPordAmd(String amdNo, Connection conn) throws RemoteException, ITMException
/**Modified by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]
[changed method signature to pass xtraParams to update login user and login terminal]*/
//public String ConfirmPordAmd(String amdNo, Connection conn) throws RemoteException, ITMException
public String ConfirmPordAmd(String amdNo, String xtraParams, Connection conn) throws RemoteException, ITMException
{
PreparedStatement pstmt = null, pstmt1 = null, pstmt3 = null, pstmtSql = null, pstmt4 = null,pstmt2 = null,pstmt5 = null,pstmt6 = null, pstmt7 = null, pstmtmax = null, pstmtcount = null,pstmtupd = null;
PreparedStatement pstmtopen=null,pstmtrcp=null,pstmtret=null,pstmtold=null;
......@@ -493,7 +499,11 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
boolean ValueType = false, firstNull=true;
DistCommon discommon = new DistCommon();
/**Modified by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
String loginUsr = "", termId = "", itemCodeInd = "", siteCodeInd= "";
Timestamp reqDateInd = null;
double quantityOld = 0;
/**Modified by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
//GenericUtility genericUtility = GenericUtility.getInstance();
ITMDBAccessEJB itmDBAccessLocal = new ITMDBAccessEJB();
String termCode = "", descr = "", printOpt = "";
......@@ -505,7 +515,12 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
String sysDateStr = sdf.format(currentDate.getTime());
System.out.println("Now the date is :=> " + sysDateStr);
sysDate = Timestamp.valueOf(genericUtility.getValidDateString(sysDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
/**Modified by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
loginUsr = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
termId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId");
InvDemSuppTraceBean invDemSupTrcBean = new InvDemSuppTraceBean();
HashMap demandSupplyMap = new HashMap();
/**Modified by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
sql = " select purc_order,site_code__dlv,site_code__ord,site_code__bill,dept_code,emp_code,item_ser,tax_opt," + " cr_term,ord_amt,tax_amt,tot_amt,curr_code,exch_rate,tax_chap,tax_class,tax_env,remarks,tax_date," + " proj_code,sales_pers,comm_perc,comm_perc__on,curr_code__comm,quot_no,tran_code,frt_amt,curr_code__frt," + " frt_term,dlv_term,insurance_amt,curr_code__ins,emp_code__aprv,ref_date,amd_date,supp_code," + " FRT_TYPE, FRT_RATE,FRT_AMT__QTY, FRT_AMT__FIXED " + " from poamd_hdr where amd_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, amdNo);
......@@ -967,7 +982,10 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
}
if (indNo != null && indNo.trim().length() > 0)
{
sql = " select quantity__stduom,ord_qty from indent where ind_no = ? ";
/**Modified by Pavan Rane 24dec19 start[fetiching colums like eq_date, item_code, site_code to update with demand/supply in summary table(RunMRP process) related changes]*/
//sql = " select quantity__stduom,ord_qty from indent where ind_no = ? ";
sql = " select quantity__stduom,ord_qty, req_date, item_code, site_code from indent where ind_no = ? ";
/**Modified by Pavan Rane 24dec19 end[fetiching colums like eq_date, item_code, site_code to update with demand/supply in summary table(RunMRP process) related changes]*/
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, indNo);
rs = pstmt.executeQuery();
......@@ -975,6 +993,11 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
{
indquantity = rs.getDouble("quantity__stduom");//Changed variable to indquantity from quantity for indent value by Priyanka Das
ordQty = rs.getDouble("ord_qty");
/**Modified by Pavan Rane 24dec19 start[fetiching colums like eq_date, item_code, site_code to update with demand/supply in summary table(RunMRP process) related changes]*/
reqDateInd = rs.getTimestamp("req_date");
itemCodeInd = rs.getString("item_code");
siteCodeInd = rs.getString("site_code");
/**Modified by Pavan Rane 24dec19 end[fetiching colums like eq_date, item_code, site_code to update with demand/supply in summary table(RunMRP process) related changes]*/
}
rs.close();
rs = null;
......@@ -997,7 +1020,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
pstmt = null;
totOrdQty = (ordQty - quantStduom) + quantityStduom;
System.out.println("totOrdQty["+totOrdQty+"] ordQty["+ordQty+"] quantStduom["+quantStduom+"] quantityStduom["+quantityStduom+"]");
if (indquantity > totOrdQty)//Changed variable to indquantity from quantity for indent value by Priyanka Das
{
sql = " update indent set status = 'O', status_date = ? , ord_qty = ?," + " unit__ord = ? where ind_no = ? ";
......@@ -1029,7 +1052,32 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
errCode = "VTINDUPD";
errCode = itmDBAccessLocal.getErrorString("", errCode, "","",conn);
return errCode;
}/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
else
{
//InvDemSuppTraceBean invDemSupTrcBean = new InvDemSuppTraceBean();
//HashMap demandSupplyMap = new HashMap();
demandSupplyMap.put("site_code", siteCodeInd);
demandSupplyMap.put("item_code", itemCodeInd);
demandSupplyMap.put("ref_ser", "IND");
demandSupplyMap.put("ref_id", indNo);
demandSupplyMap.put("ref_line", "NA");
demandSupplyMap.put("due_date", reqDateInd);
demandSupplyMap.put("demand_qty", 0.0);
demandSupplyMap.put("supply_qty", (totOrdQty- ordQty) *(-1));
demandSupplyMap.put("change_type", "C");
demandSupplyMap.put("chg_process", "T");
demandSupplyMap.put("chg_user", loginUsr);
demandSupplyMap.put("chg_term", termId);
errString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn);
demandSupplyMap.clear();
if(errString != null && errString.trim().length() > 0)
{
System.out.println("errString["+errString+"]");
return errString;
}
}
/**Added by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
}
System.out.println("@@@@@@ lineNoOrd indNo [" + indNo + "]:::lineNoOrd[" + lineNoOrd + "]");
......@@ -1037,8 +1085,10 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
if (lineNoOrd != null && lineNoOrd.trim().length() > 0)
{
System.out.println("@@@@@@ inside indNo [" + indNo + "]:::lineNoOrd[" + lineNoOrd + "]");
sql3 = " select item_code from porddet where purc_order = ? and line_no = ? ";
/**Modified by Pavan Rane 24dec19 start[fetching quantity__stduom to with update demand/supply in summary table(RunMRP process) related changes]*/
//sql3 = " select item_code from porddet where purc_order = ? and line_no = ? ";
sql3 = " select item_code, quantity__stduom from porddet where purc_order = ? and line_no = ? ";
/**Modified by Pavan Rane 24dec19 end[fetching quantity__stduom to with update demand/supply in summary table(RunMRP process) related changes]*/
pstmt3 = conn.prepareStatement(sql3);
pstmt3.setString(1, purcOrder);
pstmt3.setString(2, lineNoOrd);
......@@ -1046,6 +1096,7 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
if (rs3.next())
{
oldItem = rs3.getString("item_code");
quantityOld = rs3.getDouble("quantity__stduom");
{
System.out.println("@@@@@@@@@@oldItem[" + oldItem + "]::::itemCode[" + itemCode + "]");
......@@ -1121,7 +1172,27 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
errCode = itmDBAccessLocal.getErrorString("", errCode, "","",conn);
return errCode;
}
/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
demandSupplyMap.put("site_code",siteCode);
demandSupplyMap.put("item_code", oldItem);
demandSupplyMap.put("ref_ser", "P-ORD");
demandSupplyMap.put("ref_id", purcOrder);
demandSupplyMap.put("ref_line", lineNoOrd);
demandSupplyMap.put("due_date", reqDate);
demandSupplyMap.put("demand_qty", 0.0);
demandSupplyMap.put("supply_qty", (quantityStduom - quantityOld));
demandSupplyMap.put("change_type", "C");
demandSupplyMap.put("chg_process", "T");
demandSupplyMap.put("chg_user", loginUsr);
demandSupplyMap.put("chg_term", termId);
errString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn);
demandSupplyMap.clear();
if(errString != null && errString.trim().length() > 0)
{
System.out.println("errString["+errString+"]");
return errString;
}
/**Added by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
// modify for ORO on 15/12/14 by cpatil start
System.out.println("@@@@@@@@@@@- code for P-ORO-----");
......@@ -1545,7 +1616,27 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
demandSupplyMap.put("site_code",siteCode);
demandSupplyMap.put("item_code", itemCode);
demandSupplyMap.put("ref_ser", "P-ORD");
demandSupplyMap.put("ref_id", purcOrder);
demandSupplyMap.put("ref_line", lineNoOrd);
demandSupplyMap.put("due_date", reqDate);
demandSupplyMap.put("demand_qty", 0.0);
demandSupplyMap.put("supply_qty", quantityStduom);
demandSupplyMap.put("change_type", "A");
demandSupplyMap.put("chg_process", "T");
demandSupplyMap.put("chg_user", loginUsr);
demandSupplyMap.put("chg_term", termId);
errString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn);
demandSupplyMap.clear();
if(errString != null && errString.trim().length() > 0)
{
System.out.println("errString["+errString+"]");
return errString;
}
/**Modified by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
/*
* sql =
* " insert into taxtran ( tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,tax_chap,tax_base,tax_env,"
......@@ -1844,6 +1935,27 @@ insert into obj_itemchange(obj_name,form_no,field_name)values('porderamd
// if (cnt == 0)
if (cnt > 0) //Change condtion from if (cnt == 0) to if (cnt > 0) VALLABH KADAM 20/NOV/14
{
/**Modified by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
demandSupplyMap.put("site_code",siteCode);
demandSupplyMap.put("item_code", itemCode);
demandSupplyMap.put("ref_ser", "P-ORD");
demandSupplyMap.put("ref_id", purcOrder);
demandSupplyMap.put("ref_line", lineNoPO);
demandSupplyMap.put("due_date", reqDate);
demandSupplyMap.put("demand_qty", 0.0);
demandSupplyMap.put("supply_qty", quantityStduom);
demandSupplyMap.put("change_type", "A");
demandSupplyMap.put("chg_process", "T");
demandSupplyMap.put("chg_user", loginUsr);
demandSupplyMap.put("chg_term", termId);
errString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn);
demandSupplyMap.clear();
if(errString != null && errString.trim().length() > 0)
{
System.out.println("errString["+errString+"]");
return errString;
}
/**Modified by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
/*
* sql =
* " insert into taxtran ( tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,tax_chap,tax_base,tax_env,"
......
......@@ -12,6 +12,7 @@ import ibase.webitm.ejb.dis.DistCommon;
import ibase.utility.CommonConstants;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.mfg.InvDemSuppTraceBean;
import ibase.webitm.ejb.sys.UtilMethods;
//import ibase.webitm.reports.sun.PackingSlipSOrderFormulation;
import ibase.webitm.utility.TransIDGenerator;
......@@ -801,9 +802,38 @@ public class StockUpdate
pstmt.setString(40,this.refSerFor);
pstmt.setString(41,this.refIdFor);
update = pstmt.executeUpdate();
int updCnt = update = pstmt.executeUpdate();
System.out.println("No recore Insert invtrace ::- ["+update+"]");
pstmt.close();
/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
if(updCnt > 0 )
{
InvDemSuppTraceBean invDemSupTrcBean = new InvDemSuppTraceBean();
HashMap demandSupplyMap = null;
if( !("D-ISS".equalsIgnoreCase(this.tranSer.trim()) || "S-DSP".equalsIgnoreCase(this.tranSer.trim())) )
{
demandSupplyMap = new HashMap();
demandSupplyMap.put("site_code", this.siteCode);
demandSupplyMap.put("item_code", this.itemCode);
demandSupplyMap.put("ref_ser", "STK");
demandSupplyMap.put("ref_id", "NA");
demandSupplyMap.put("ref_line", "NA");
demandSupplyMap.put("due_date", this.tranDate);
demandSupplyMap.put("demand_qty", 0.0);
demandSupplyMap.put("supply_qty", effQty);
demandSupplyMap.put("change_type", "A");
demandSupplyMap.put("chg_process", "T");
demandSupplyMap.put("chg_user", userId);
demandSupplyMap.put("chg_term", termId);
errString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn);
if(errString != null && errString.trim().length() > 0)
{
System.out.println("retString["+errString+"]");
return errString;
}
}
}
/**Added by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
}
errString = updateStockMovement(conn);
......@@ -2811,7 +2841,36 @@ public class StockUpdate
System.out.println("CHG_USER :");
System.out.println("CHG_TERM :");
pstmt.executeUpdate();
int updCnt = pstmt.executeUpdate();
/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
if( updCnt > 0 )
{
InvDemSuppTraceBean invDemSupTrcBean = new InvDemSuppTraceBean();
HashMap demandSupplyMap = null;
if( !("D-ISS".equalsIgnoreCase(this.tranSer.trim()) || "S-DSP".equalsIgnoreCase(this.tranSer.trim())) )
{
demandSupplyMap = new HashMap();
demandSupplyMap.put("site_code", this.siteCode);
demandSupplyMap.put("item_code", this.itemCode);
demandSupplyMap.put("ref_ser", "STK");
demandSupplyMap.put("ref_id", "NA");
demandSupplyMap.put("ref_line", "NA");
demandSupplyMap.put("due_date", this.tranDate);
demandSupplyMap.put("demand_qty", 0.0);
demandSupplyMap.put("supply_qty", effQty);
demandSupplyMap.put("change_type", "A");
demandSupplyMap.put("chg_process", "T");
demandSupplyMap.put("chg_user", userId);
demandSupplyMap.put("chg_term", termId);
errString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn);
if(errString != null && errString.trim().length() > 0)
{
System.out.println("retString["+errString+"]");
return errString;
}
}
}
/**Added by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
sql = "select fin_entity from site where site_code = '"+this.siteCode+"'";
System.out.println("SQL :"+sql);
......
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