Commit 0d15e1b7 authored by prane's avatar prane

bug fixed while testing Batch no case and changes done related to split and expiry logic

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@213644 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 56329a9c
package ibase.webitm.ejb.dis;
import ibase.utility.EMail;
import ibase.utility.CommonConstants;
import ibase.webitm.utility.*;
import ibase.webitm.ejb.*;
import ibase.webitm.ejb.mfg.ExplodeBom;
//import ibase.utility.EMail;
//import ibase.utility.CommonConstants;
//import ibase.webitm.utility.*;
//import ibase.webitm.ejb.*;
/*import ibase.webitm.ejb.mfg.ExplodeBom;
import ibase.webitm.ejb.mfg.adv.RcpBackflushConfirm;
import ibase.webitm.ejb.sys.*;
import ibase.system.config.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.ITMException;*/
import java.text.*;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.ejb.fin.*;
import ibase.webitm.utility.TransIDGenerator;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.dis.*;
//import ibase.webitm.ejb.fin.*;
//import ibase.webitm.utility.TransIDGenerator;
//import ibase.webitm.ejb.ITMDBAccessEJB;
//import ibase.webitm.ejb.dis.*;
import java.rmi.RemoteException;
import java.sql.*;
import java.util.*;
import javax.ejb.*;
/*import javax.ejb.*;
import javax.naming.InitialContext;
import javax.ejb.Stateless;
import javax.ejb.Stateless;*/
import org.apache.axis.client.Call;
/*import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.encoding.XMLType;*/
//import org.drools.runtime.pipeline.SmooksTransformerProvider;
import org.w3c.dom.*;
//import org.w3c.dom.*;
import javax.xml.rpc.ParameterMode;
/*import javax.xml.rpc.ParameterMode;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.parsers.*;
import java.text.SimpleDateFormat;
*/
/*import java.text.SimpleDateFormat;
import ibase.utility.CommonConstants;
//import ibase.utility.GenericUtility;
import ibase.utility.GenericUtility;
import ibase.webitm.ejb.E12CreateBatchLoadEjb;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.sys.CreateRCPXML;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.ITMException;*/
import java.rmi.RemoteException;
//import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
......@@ -59,7 +59,7 @@ import java.util.HashMap;
import javax.ejb.Stateless;
import ibase.system.config.ConnDriver;
//import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants;
import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessEJB;
......@@ -105,7 +105,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
{
PreparedStatement pstmtSql = null;
ResultSet rs = null;
FinCommon finCommon = null;
//FinCommon finCommon = null;
// GenericUtility genericUtility = null;
ITMDBAccessEJB itmDBAccessEJB = null;
ValidatorEJB validatorEJB = null;
......@@ -122,15 +122,15 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
{
if (conn == null)
{
ConnDriver connDriver = null;
connDriver = new ConnDriver();
//ConnDriver connDriver = null;
//connDriver = new ConnDriver();
// conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
conn.setAutoCommit(false);
connDriver = null;
//connDriver = null;
connStatus = true;
}
finCommon = new FinCommon();
//finCommon = new FinCommon();
// genericUtility = new GenericUtility();
itmDBAccessEJB = new ITMDBAccessEJB();
validatorEJB = new ValidatorEJB();
......@@ -337,7 +337,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
String xtraParams) throws RemoteException, ITMException
{
PreparedStatement pstmtSql = null, pstmtInsert = null, pstmtInner = null, pstmtLot=null;
ResultSet rs = null, rsInner = null, rsLot= null;
ResultSet rs = null, rsInner = null, rsLot = null;
String dbName = "";
String sql = "";
String retString = "";
......@@ -379,12 +379,14 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
String mid1 = "", mid2 = "", mid3 = "", mid4 = "";
java.text.SimpleDateFormat sdf = null;
String lotnofrom = "", lotnoto1 = "";
String priceListOldto = "", priceListOldFr="";
Timestamp efffromSplit = null, ValidUpToSplit = null;
double minqtySplit = 0.0, maxqtySplit = 0.0, rate1Split = 0.0;
String ratetypeSplit = "", PriceListParent1Split = "", refNo1Split = "", refNoold1Split = "";
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
termId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId");
double minqtySplit = 0.0, maxqtySplit = 0.0, rate1Split = 0.0;
String ratetypeSplit = "", PriceListParent1Split = "", refNo1Split = "", refNoold1Split = "";
String updLotFrom = "", LotNoFromUpd="";
Timestamp efffromSplit = null, ValidUpToSplit = null;
String priceListOldFr = "",priceListOldto = "";
try
{
System.out.println("----------------------------- Inside Insert Pricelist method ---------------");
......@@ -447,7 +449,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
sql = "select lot_no__from, lot_no__to from pricelist where price_list = ? and item_code = ? "
+ " and unit = ? and list_type = ? and lot_no__from <= ? and min_qty <= ? and max_qty >= ? order by lot_no__from";
pstmtLot = conn.prepareStatement(sql);
for (Ctr = 0; Ctr < PricelistGen.size(); Ctr++)
{
System.out.println("Insert For loop.....................................");
......@@ -493,12 +495,13 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
System.out.println("[orderType1]----[" + orderType1 + "]");
chgref1 = (String) PList.get("CHG_REF_NO");
System.out.println("[chgref1]----[" + chgref1 + "]");
updLotFrom = lotnofrom;
pstmtInner.setString(1, plist);
pstmtInner.setString(2, itemcode);
rsInner = pstmtInner.executeQuery();
// Pavan R 6may19 end
if (rsInner.next())
//if (rsInner.next())//Pavan R DEC19
while (rsInner.next())
{
ValidUpTo = rsInner.getTimestamp("valid_upto");
System.out.println("Valid upto in price list" + ValidUpTo);
......@@ -512,11 +515,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
MinQtyBrow = rsInner.getDouble("min_qty");
MaxQtyBrow = rsInner.getDouble("max_qty");
System.out.println("Minimum value is@@@@@@@@@" + MinQtyBrow);
priceListOldto = LotNoToBrow;
priceListOldFr = LotFrBrow;
PList.put("LOT_NO__TO_OLD", LotNoToBrow);
//K = LotNoToBrow;
System.out.println("Split priceListOldFr ["+priceListOldFr+"] priceListOldto["+priceListOldto+"]");
System.out.println("---------------------- Check if Conditon -----------------------");
DayDiff = (int) utilMethods.DaysAfter(ValidUpTo, EffDate);
System.out.println("DayDiff-----------[" + DayDiff + "]");
......@@ -524,7 +523,8 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
{
System.out.println("In if condition@@@@@");
if (LotFrBrow == lotnofrom && LotNoToBrow == lotnoto1)
//if (LotFrBrow == lotnofrom && LotNoToBrow == lotnoto1) //Pavan R DEC19
if (LotFrBrow.equals(lotnofrom) && LotNoToBrow.equals(lotnoto1))
{
System.out.println("In if condition ######");
ValidUpTo = utilMethods.RelativeDate((java.sql.Timestamp) PList.get("EFF_FROM"), -1);
......@@ -611,6 +611,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
if (Count > 0)
{
//Pavan Rane 09DEc19[to hold lot_no__to to update on splited price list] start
pstmtLot.setString(1, plist);
pstmtLot.setString(2, itemcode);
......@@ -630,7 +631,6 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
rsLot = null;
pstmtLot.clearParameters();
//Pavan Rane 09DEc19[to hold lot_no__to to update on splited price list] end
String s2 = LotNoFrom.trim();
System.out.println("Lotnumber " + s2.length());
left = 0;
......@@ -734,11 +734,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
pstmtSql.close();
pstmtSql = null;
}
if(priceListOldFr.compareTo(LotNoFrom) <= 0)
{
PList.put("LOT_NO__TO_OLD", LotNoFrom);
}
updLotFrom = LotNoFrom;
//}
}//count end
}//if (listtype.equalsIgnoreCase("B"))
......@@ -754,6 +750,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
pstmtLot = null;
}
} // end autoexpire if
///////////////
// astr_PL.list_type = 'B'
......@@ -762,7 +759,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
// change the valid upto date of price before the eff from date and batch no
// less then the
// plist1 = (String)PList.get("price_list");
System.out.println("---PricelistGen["+PricelistGen+"]-Ctr["+PricelistGen.size()+"]");
System.out.println("---PricelistGen["+PricelistGen+"]-Ctr["+PricelistGen.size()+"]updLotFrom["+updLotFrom+"]");
for (pListCtr = 0; pListCtr < PricelistGen.size(); pListCtr++)
{
PList = (HashMap) PricelistGen.get(pListCtr);
......@@ -816,6 +813,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
System.out.println("@@@@@lot number from" + LotNoFrom);
if (refNoold != null && refNoold.trim().length() > 0)
{
//Modified By Pavan Rane 05dec19 start[issue as previous valid pricelist expired wrongly]
//sql = "select count(*) from pricelist where price_list= ? and item_code = ? and unit = ? and lot_no__from >= ? and list_type = ? and min_qty >= ? and max_qty <= ? and ref_no = ?";
sql = "select count(*) from pricelist where price_list= ? and item_code = ? and unit = ? and lot_no__from <= ? and lot_no__to >= ? and list_type = ? and min_qty <= ? and max_qty >= ? and ref_no = ?";
......@@ -823,20 +821,23 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
pstmtSql.setString(1, plist);
pstmtSql.setString(2, itemcode);
pstmtSql.setString(3, unit);
pstmtSql.setString(4, lotnofrom);
pstmtSql.setString(4, lotnofrom);
/*pstmtSql.setString(5, listtype);
pstmtSql.setDouble(6, minqty);
pstmtSql.setDouble(7, maxqty);
pstmtSql.setString(8, refNoold);*/
pstmtSql.setString(5, lotnofrom);
pstmtSql.setString(6, listtype);
pstmtSql.setDouble(7, minqty);
pstmtSql.setDouble(8, maxqty);
pstmtSql.setString(9, refNoold);
rs = pstmtSql.executeQuery();
//System.out.println("COUNT" + countup);
//Modified By Pavan Rane 05dec19 end [issue as previous valid pricelist expired wrongly]
System.out.println("COUNT" + countup);
if (rs.next())
{
countup = rs.getInt(1);
}
System.out.println("RefNoOld countup["+countup+"]");
rs.close();
rs = null;
pstmtSql.close();
......@@ -846,23 +847,25 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
{
//Modified By Pavan Rane 05dec19 start[issue as previous valid pricelist expired wrongly]
//sql = "select count(*) from pricelist where price_list= ? and item_code = ? and unit = ? and lot_no__from >= ? and list_type = ? and min_qty >= ? and max_qty <= ? and ref_no is null ";
sql = "select count(*) from pricelist where price_list= ? and item_code = ? and unit = ? and lot_no__from <= ? and lot_no__to >= ? and list_type = ? and min_qty <= ? and max_qty >= ? and ref_no is null ";
sql = "select count(*) from pricelist where price_list= ? and item_code = ? and unit = ? and lot_no__from <= ? and lot_no__to >= ? and list_type = ? and min_qty <= ? and max_qty >= ? and ref_no is null ";
pstmtSql = conn.prepareStatement(sql);
pstmtSql.setString(1, plist);
pstmtSql.setString(2, itemcode);
pstmtSql.setString(3, unit);
pstmtSql.setString(4, lotnofrom);
/*pstmtSql.setString(5, listtype);
pstmtSql.setDouble(6, minqty);
pstmtSql.setDouble(7, maxqty);*/
pstmtSql.setString(5, lotnofrom);
pstmtSql.setString(6, listtype);
pstmtSql.setDouble(7, minqty);
pstmtSql.setDouble(8, maxqty);
rs = pstmtSql.executeQuery();
//Modified By Pavan Rane 05dec19 end[issue as previous valid pricelist expired wrongly]
//System.out.println("COUNT" + countup);
System.out.println("COUNT" + countup);
if (rs.next()) {
countup = rs.getInt(1);
}
System.out.println("RefNoOld NUll countup["+countup+"]");
rs.close();
rs = null;
pstmtSql.close();
......@@ -873,7 +876,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
if (refNoold != null && refNoold.trim().length() > 0) {
//Modified By Pavan Rane 05dec19 start[issue as previous valid pricelist expired wrongly]
//sql = "select slab_no,eff_from ,lot_no__from from pricelist where price_list = ? and item_code = ? and unit = ? and lot_no__from >= ? and list_type = ? and min_qty >= ? and max_qty <= ? and ref_no = ?";
sql = "select slab_no,eff_from ,lot_no__from from pricelist where price_list = ? and item_code = ? and unit = ? and lot_no__from <= ? and lot_no__to >= ? and list_type = ? and min_qty <= ? and max_qty >= ? and ref_no = ?";
sql = "select slab_no,eff_from ,lot_no__from from pricelist where price_list = ? and item_code = ? and unit = ? and lot_no__from <= ? and lot_no__to >= ? and list_type = ? and min_qty <= ? and max_qty >= ? and ref_no = ?";
pstmtSql = conn.prepareStatement(sql);
// pstmtSql.setDouble(1, slabno);
// pstmtSql.setTimestamp(2, efffromdt);
......@@ -882,13 +885,16 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
pstmtSql.setString(2, itemcode);
pstmtSql.setString(3, unit);
pstmtSql.setString(4, lotnofrom);
/*pstmtSql.setString(5, listtype);
pstmtSql.setDouble(6, minqty);
pstmtSql.setDouble(7, maxqty);
pstmtSql.setString(8, refNoold);*/
pstmtSql.setString(5, lotnofrom);
pstmtSql.setString(6, listtype);
pstmtSql.setDouble(7, minqty);
pstmtSql.setDouble(8, maxqty);
pstmtSql.setString(9, refNoold);
rs = pstmtSql.executeQuery();
//Modified By Pavan Rane 05dec19 end[issue as previous valid pricelist expired wrongly]
if (rs.next())
{
SlabNo = rs.getDouble(1);
......@@ -913,11 +919,13 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
pstmtSql.setString(2, itemcode);
pstmtSql.setString(3, unit);
pstmtSql.setString(4, lotnofrom);
/*pstmtSql.setString(5, listtype);
pstmtSql.setDouble(6, minqty);
pstmtSql.setDouble(7, maxqty);*/
pstmtSql.setString(5, lotnofrom);
pstmtSql.setString(6, listtype);
pstmtSql.setDouble(7, minqty);
pstmtSql.setDouble(8, maxqty);
//Modified By Pavan Rane 05dec19 end[issue as previous valid pricelist expired wrongly]
rs = pstmtSql.executeQuery();
if (rs.next()) {
SlabNo = rs.getDouble(1);
......@@ -1082,6 +1090,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
pstmtSql.close();
pstmtSql = null;
}
}
} else
......@@ -1126,6 +1135,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
pstmtSql = null;
}
}
updLotFrom = LotNoFrom;
}
}
}
......@@ -1135,21 +1145,16 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
if (listtype.equalsIgnoreCase("B"))
{
LotNoFrom = (String) PList.get("LOT_NO__FROM");
LotNoTo = (String) PList.get("LOT_NO__TO");
System.out.println("@@@@@lot number from2222222222222" + LotNoFrom);
//sql = "select count(1) from pricelist where price_list = ? and item_code = ? and unit = ? and list_type = ? and lot_no__from <= ? and lot_no__to >= ? and min_qty <= ? and max_qty >= ?";
sql = "select count(1) from pricelist where price_list = ? and item_code = ? and unit = ? and list_type = ? and lot_no__from <= ? and lot_no__to >= ? and min_qty <= ? and max_qty >= ?";
pstmtSql = conn.prepareStatement(sql);
pstmtSql.setString(1, plist);
pstmtSql.setString(2, itemcode);
pstmtSql.setString(3, unit);
pstmtSql.setString(4, listtype);
//Modified By Pavan Rane 05dec19 start[split logic to be checked for given case]
//pstmtSql.setString(5, LotFrBrow);
//pstmtSql.setString(6, LotNoToBrow);
pstmtSql.setString(5, LotNoFrom);
pstmtSql.setString(6, (String)PList.get("LOT_NO__TO_OLD"));//pstmtSql.setString(6, priceListOldFr);//LotFrBrow;
//Modified By Pavan Rane 05dec19 end[split logic to be checked for given case]
pstmtSql.setString(5, LotFrBrow);
//pstmtSql.setString(6, LotNoToBrow);
pstmtSql.setString(6, updLotFrom);
pstmtSql.setDouble(7, minqty);
pstmtSql.setDouble(8, maxqty);
rs = pstmtSql.executeQuery();
......@@ -1171,29 +1176,23 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
LotNoFrom = (String) PList.get("LOT_NO__FROM");
LotNoTo = (String) PList.get("LOT_NO__TO");
nextlotnofr = LotNoFrom;
//Modified By Pavan Rane 05dec19 start
/**To get details for splited pricelist for split logic to be checked for given case*/
//sql = "select lot_no__from, lot_no__to from pricelist where price_list = ? and item_code = ? and unit = ? and list_type = ? and lot_no__from <= ? and lot_no__to >= ? and min_qty <= ? and max_qty >= ? order by lot_no__from";
//sql = "select lot_no__from, lot_no__to, eff_from, valid_upto, min_qty, max_qty, rate,rate_type, price_list__parent, ref_no, ref_no_old from pricelist where price_list = ? and item_code = ? and unit = ? and list_type = ? and lot_no__from <= ? and lot_no__to >= ? and min_qty <= ? and max_qty >= ? order by lot_no__from";
//sql = "select lot_no__from, lot_no__to from pricelist where price_list = ? and item_code = ? and unit = ? and list_type = ? and lot_no__from <= ? and lot_no__to >= ? and min_qty <= ? and max_qty >= ? order by lot_no__from";
sql = "select lot_no__from, lot_no__to, eff_from, valid_upto, min_qty, max_qty, rate,rate_type, price_list__parent, ref_no, ref_no_old from pricelist where price_list = ? and item_code = ? and unit = ? and list_type = ? and lot_no__from <= ? and lot_no__to >= ? and min_qty <= ? and max_qty >= ? order by lot_no__from";
pstmtSql = conn.prepareStatement(sql);
pstmtSql.setString(1, plist);
pstmtSql.setString(2, itemcode);
pstmtSql.setString(3, unit);
pstmtSql.setString(4, listtype);
//pstmtSql.setString(5, lotnofrom);
pstmtSql.setString(5, lotnofrom);
//pstmtSql.setString(6, LotNoToBrow);
pstmtSql.setString(5, LotNoFrom);
pstmtSql.setString(6, (String)PList.get("LOT_NO__TO_OLD"));
pstmtSql.setString(6, updLotFrom);
pstmtSql.setDouble(7, minqty);
pstmtSql.setDouble(8, maxqty);
rs = pstmtSql.executeQuery();
//while (rs.next())
if(rs.next())
while (rs.next())
{
//currentlotnofr = rs.getString(1);
//currentlotnoto = rs.getString(2);
currentlotnofr = rs.getString(1);
currentlotnoto = rs.getString(2);
currentlotnofr = rs.getString("lot_no__from");
currentlotnoto = rs.getString("lot_no__to");
efffromSplit = rs.getTimestamp("eff_from");
......@@ -1207,12 +1206,10 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
refNoold1Split = rs.getString("ref_no_old");
// }
recordfound = true;
System.out.println("Recode Found##########" + recordfound);
System.out.println("Recode Found@@@@@@@@@@@@@" + recordfound);
currentlotnofrtemp = currentlotnofr;
currentlotnototemp = currentlotnoto;
//************Pavan R start
/* Len = currentlotnofr.trim().length();
Ctr = 1;
OrigStr = "";
......@@ -1221,16 +1218,15 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
New = 0;
int diff3 = 0, cntt = 0;
String original = "", result = "", result2 = "";
System.out.println("LotNoFrom["+LotNoFrom+"] currentlotnofr["+currentlotnofr+"]");
String x = LotNoFrom.trim();
System.out.println("@@@@@x" + x);
String y = currentlotnofr.trim();
System.out.println("@@@@@y" + y);
System.out.println("@@@@@x" + y);
String s2 = y;
if (x.compareTo(y) < 0)
{
/*
* char right3= y.charAt(y.length()-1); if(Character.isDigit(right3) ) { do {
* if(Character.isDigit(right3) ) { left3=y.charAt(0); if(left3=='0') {
*
......@@ -1250,7 +1246,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
* nextlotnofr;
int length = currentlotnofr.trim().length();
System.out.println("x.compareTo(y) loop: s2=" + s2);
System.out.println("s22222222222222" + s2);
// char right= s2.charAt(s2.length()-1);
......@@ -1304,7 +1300,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
System.out.println("testSub2::-" + testSub2);
sub = Integer.parseInt(testSub2);
int u2 = testSub2.length();
int OrgSub = sub + 1;
int OrgSub = sub - 1;
String v1 = String.valueOf(OrgSub);
int v2 = v1.length();
System.out.println("V2:" + v2);
......@@ -1332,16 +1328,13 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
Set = "";
NewStr = "";
New = 0;
//String p = currentlotnoto.trim();
//String q = LotNoTo.trim();
String q = currentlotnoto.trim();
String p = LotNoTo.trim();
String p = currentlotnoto.trim();
String q = LotNoTo.trim();
s2 = currentlotnoto.trim();
int length = currentlotnoto.trim().length();
System.out.println("currentlotnoto["+currentlotnoto+"] LotNoTo["+LotNoTo+"]");
System.out.println("p--[" + p + "]q--[" + q + "]");
System.out.println("s2" + s2);
System.out.println("s22222222222222" + s2);
if (q.compareTo(p) < 0)
{
......@@ -1380,7 +1373,6 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
//if (isNumber(s2.charAt(s2.length() - 1)))
//Pavan Rane 21aug19[to set allow alphbet at right side]....end
{
cnt1 = 0;
for (int i = length - 1; i >= 0; i--)
{
......@@ -1434,8 +1426,8 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
}
}*/
}
*/
String s2 = LotNoTo.trim();
System.out.println("Lotnumber " + s2.length());
......@@ -1521,7 +1513,8 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
String a2 = Integer.toString(OrgSub);
System.out.println("NewStr" + NewStr);
nextlotnofr = testSub1.trim() + NewStr.trim() + a2;
}
int temp = 0;
if (currentlotnofrtemp != LotNoFrom) {
// temp =Integer.parseInt(LotNoFrom);
......@@ -1535,14 +1528,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
* temp2=Integer.parseInt(LotNoTo); nextlotnofr=LotNoFroma[temp]+1;
* lotnoto=LotNoToa[temp2]+1; }
*/
}
}
//Added By Pavan Rane 05dec19 start[closed open cursors]
rs.close();
rs = null;
pstmtSql.close();
pstmtSql =null;
System.out.println("LotNoFromaList["+LotNoFroma+"]");
for (int i = 0; i < LotNoFroma.size(); i++)
{
lotnofr = LotNoFroma.get(i);
......@@ -1555,13 +1541,17 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
rs = pstmtSql.executeQuery();
if (rs.next()) {
LineNo = rs.getInt(1);
System.out.println("line no#1394@@@@@@@" + LineNo);
System.out.println("line no@@@@@@@" + LineNo);
}
rs.close();
rs = null;
pstmtSql.close();
pstmtSql = null;
//if (LineNo == 0) {
LotNoFromUpd = (String) PList.get("LOT_NO__FROM");
//LotNoToUpd = (String) PList.get("LOT_NO__TO");
if(LotNoFromUpd.compareTo(priceListOldto) < 0) {
System.out.println("Insert line no");
LineNo++;
sql = "insert into pricelist (price_list, item_code,unit,list_type,slab_no,eff_from,valid_upto,lot_no__from,lot_no__to,min_qty,max_qty,rate,rate_type,min_rate,chg_date,chg_user,chg_term,max_rate,order_type, price_list__parent, chg_ref_no, ref_no,ref_no_old )"
......@@ -1590,13 +1580,13 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
pstmtInsert.setString(20, PriceListParent1Split);
pstmtInsert.setString(21, chgref1);
pstmtInsert.setString(22, refNo1Split);
pstmtInsert.setString(23, refNoold1Split);
pstmtInsert.setString(23, refNoold1Split);
UpdCnt = pstmtInsert.executeUpdate();
pstmtInsert.close();
pstmtInsert = null;
//}
//Modified By Pavan Rane 05dec19 start[To get details for splited pricelist for split logic to be checked for given case]
}
}
}
}
......@@ -1636,7 +1626,6 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
newCount = rs.getInt(1);
System.out.println("Before insert new Lot Count::["+newCount+"]");
}
//Added By Pavan Rane 05dec19 start[closed open cursors]
rs.close();
rs = null;
pstmtSql.close();
......@@ -1828,7 +1817,6 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
PList.put("ITEM_CODE", itemCode = rs.getString("item_code"));
PList.put("LOT_NO__FROM", lotNoForm = rs.getString("lot_no__from"));
PList.put("LOT_NO__TO", lotNoTo = rs.getString("lot_no__to"));
PList.put("LOT_NO__TO_OLD", lotNoTo = rs.getString("lot_no__to"));
PList.put("RATE", rate = rs.getDouble("rate"));
PList.put("RATE_TYPE", rateType = rs.getString("rate_type"));
PList.put("MIN_RATE", minrate = rs.getDouble("min_rate"));
......
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