Commit ca3bced5 authored by prane's avatar prane

Not to update demand/supply in inv_dem_supp for those location having invstat type is 'S'

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@217577 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1e9899f9
...@@ -802,35 +802,53 @@ public class StockUpdate ...@@ -802,35 +802,53 @@ public class StockUpdate
pstmt.setString(40,this.refSerFor); pstmt.setString(40,this.refSerFor);
pstmt.setString(41,this.refIdFor); pstmt.setString(41,this.refIdFor);
int updCnt = update = pstmt.executeUpdate(); update = pstmt.executeUpdate();
System.out.println("No recore Insert invtrace ::- ["+update+"]"); System.out.println("No recore Insert invtrace ::- ["+update+"]");
pstmt.close(); pstmt.close();
/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/ /**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
if(updCnt > 0 ) if(update > 0 )
{ {
InvDemSuppTraceBean invDemSupTrcBean = new InvDemSuppTraceBean(); InvDemSuppTraceBean invDemSupTrcBean = new InvDemSuppTraceBean();
HashMap demandSupplyMap = null; HashMap demandSupplyMap = null;
if( !("D-ISS".equalsIgnoreCase(this.tranSer.trim()) || "S-DSP".equalsIgnoreCase(this.tranSer.trim())) ) if( !("D-ISS".equalsIgnoreCase(this.tranSer.trim()) || "S-DSP".equalsIgnoreCase(this.tranSer.trim())) )
{ {
demandSupplyMap = new HashMap(); int invStCnt = 0;
demandSupplyMap.put("site_code", this.siteCode); sql = "select count(*) from location, invstat "
demandSupplyMap.put("item_code", this.itemCode); + " where location.inv_stat = invstat.inv_stat "
demandSupplyMap.put("ref_ser", "STK"); + " and location.loc_code = ? "
demandSupplyMap.put("ref_id", "NA"); + " and invstat.stat_type <> 'S'";
demandSupplyMap.put("ref_line", "NA"); pstmt = conn.prepareStatement(sql);
demandSupplyMap.put("due_date", this.tranDate); pstmt.setString(1, this.locationCode);
demandSupplyMap.put("demand_qty", 0.0); rs = pstmt.executeQuery();
demandSupplyMap.put("supply_qty", effQty); if(rs.next())
demandSupplyMap.put("change_type", "A"); {
demandSupplyMap.put("chg_process", "T"); invStCnt = rs.getInt(1);
demandSupplyMap.put("chg_user", userId); }
demandSupplyMap.put("chg_term", termId); rs.close();
errString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn); rs = null;
if(errString != null && errString.trim().length() > 0) pstmt.close();
{ if( invStCnt > 0 )
System.out.println("retString["+errString+"]"); {
return errString; 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]*/ /**Added by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
...@@ -2842,32 +2860,51 @@ public class StockUpdate ...@@ -2842,32 +2860,51 @@ public class StockUpdate
System.out.println("CHG_TERM :"); System.out.println("CHG_TERM :");
int updCnt = pstmt.executeUpdate(); int updCnt = pstmt.executeUpdate();
pstmt.close();
/**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/ /**Added by Pavan Rane 24dec19 start[to update demand/supply in summary table(RunMRP process) related changes]*/
if( updCnt > 0 ) if( updCnt > 0 )
{ {
InvDemSuppTraceBean invDemSupTrcBean = new InvDemSuppTraceBean(); InvDemSuppTraceBean invDemSupTrcBean = new InvDemSuppTraceBean();
HashMap demandSupplyMap = null; HashMap demandSupplyMap = null;
if( !("D-ISS".equalsIgnoreCase(this.tranSer.trim()) || "S-DSP".equalsIgnoreCase(this.tranSer.trim())) ) if( !("D-ISS".equalsIgnoreCase(this.tranSer.trim()) || "S-DSP".equalsIgnoreCase(this.tranSer.trim())) )
{ {
demandSupplyMap = new HashMap(); int invStCnt = 0;
demandSupplyMap.put("site_code", this.siteCode); sql = "select count(*) from location, invstat "
demandSupplyMap.put("item_code", this.itemCode); + " where location.inv_stat = invstat.inv_stat "
demandSupplyMap.put("ref_ser", "STK"); + " and location.loc_code = ? "
demandSupplyMap.put("ref_id", "NA"); + " and invstat.stat_type <> 'S'";
demandSupplyMap.put("ref_line", "NA"); pstmt = conn.prepareStatement(sql);
demandSupplyMap.put("due_date", this.tranDate); pstmt.setString(1, this.locationCode);
demandSupplyMap.put("demand_qty", 0.0); rs = pstmt.executeQuery();
demandSupplyMap.put("supply_qty", effQty); if(rs.next())
demandSupplyMap.put("change_type", "A"); {
demandSupplyMap.put("chg_process", "T"); invStCnt = rs.getInt(1);
demandSupplyMap.put("chg_user", userId); }
demandSupplyMap.put("chg_term", termId); rs.close();
errString = invDemSupTrcBean.updateDemandSupply(demandSupplyMap, conn); rs = null;
if(errString != null && errString.trim().length() > 0) pstmt.close();
{ if( invStCnt > 0 )
System.out.println("retString["+errString+"]"); {
return errString; 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]*/ /**Added by Pavan Rane 24dec19 end[to update demand/supply in summary table(RunMRP process) related changes]*/
......
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