Commit 64c3eb59 authored by manohar's avatar manohar

Duplicate check all the primary key column except slab_no considered


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93870 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 47a3c885
...@@ -429,6 +429,9 @@ public class PriceList extends ValidatorEJB implements PriceListLocal, PriceList ...@@ -429,6 +429,9 @@ public class PriceList extends ValidatorEJB implements PriceListLocal, PriceList
Node childNode = null; Node childNode = null;
int ctr,currentFormNo=0; int ctr,currentFormNo=0;
int childNodeListLength; int childNodeListLength;
String itemCode = "", unit = "", listType = "", effFromStr = "", validUptoStr = "", lotNoFrom = "", lotNoTo = "";
Timestamp effFrom =null, validUpto = null;
try try
{ {
conn = getConnection(); conn = getConnection();
...@@ -469,26 +472,55 @@ public class PriceList extends ValidatorEJB implements PriceListLocal, PriceList ...@@ -469,26 +472,55 @@ public class PriceList extends ValidatorEJB implements PriceListLocal, PriceList
String objName = attrMap.getNamedItem( "objName" ).getNodeValue(); String objName = attrMap.getNamedItem( "objName" ).getNodeValue();
String winName = "w_"+ objName; String winName = "w_"+ objName;
priceList = genericUtility.getColumnValue("price_list",dom); priceList = genericUtility.getColumnValue("price_list",dom);
// 14/11/13 manoharan duplicate checking to consider all parameter
itemCode = genericUtility.getColumnValue("item_code",dom);
unit = genericUtility.getColumnValue("unit",dom);
listType = genericUtility.getColumnValue("list_type",dom);
effFromStr = genericUtility.getColumnValue("eff_from",dom);
validUptoStr = genericUtility.getColumnValue("valid_upto",dom);
lotNoFrom = genericUtility.getColumnValue("lot_no__from",dom);
lotNoTo = genericUtility.getColumnValue("lot_no__to",dom);
// end 14/11/13 manoharan duplicate checking to consider all parameter
System.out.println("price_list wfvalData :::: " + priceList); System.out.println("price_list wfvalData :::: " + priceList);
sql = "select key_flag from transetup where tran_window = '"+ winName +"'"; // 14/11/13 manoharan commented as always it will be manual
pstmt = conn.prepareStatement(sql); //sql = "select key_flag from transetup where tran_window = '"+ winName +"'";
rs = pstmt.executeQuery(); //pstmt = conn.prepareStatement(sql);
if(rs.next()) //rs = pstmt.executeQuery();
{ //if(rs.next())
lskeyflag = rs.getString("key_flag")== null ?"M":rs.getString("key_flag"); //{
// lskeyflag = rs.getString("key_flag")== null ?"M":rs.getString("key_flag");
} //
rs.close();rs = null; //}
pstmt.close();pstmt = null; //rs.close();rs = null;
if("M".equals(lskeyflag) && (priceList == null || priceList.trim().length() == 0)) //pstmt.close();pstmt = null;
// if("M".equals(lskeyflag) && (priceList == null || priceList.trim().length() == 0))
if(priceList == null || priceList.trim().length() == 0 || itemCode == null || itemCode.trim().length() == 0 || unit == null || unit.trim().length() == 0 || listType == null || listType.trim().length() == 0 || effFromStr == null || effFromStr.trim().length() == 0 || validUptoStr == null || validUptoStr.trim().length() == 0 || lotNoFrom == null || lotNoFrom.trim().length() == 0 || lotNoTo == null || lotNoTo.trim().length() == 0)
{ {
errCode = "VMCODNULL"; errCode = "VMCODNULL";
errString = getErrorString("price_list",errCode,userId); errString = getErrorString("price_list",errCode,userId);
} }
else if ("A".equals(editFlag)) else if ("A".equals(editFlag))
{ {
sql = "select count(*) from pricelist where price_list = '"+priceList+"'"; System.out.println("before effFromStr [" + effFromStr + "] validUptoStr [" + validUptoStr + "]");
effFromStr = genericUtility.getValidDateString(effFromStr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat());
validUptoStr = genericUtility.getValidDateString(validUptoStr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat());
System.out.println("after effFromStr [" + effFromStr + "] validUptoStr [" + validUptoStr + "]");
effFrom = Timestamp.valueOf(effFromStr + " 00:00:00");
validUpto = Timestamp.valueOf(validUptoStr + " 00:00:00");
sql = "select count(*) from pricelist where price_list = ? "
+ " and item_code = ? and unit = ? and list_type = ? "
+ " and eff_from = ? and valid_upto = ? "
+ " and lot_no__from = ? and lot_no__to = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,priceList);
pstmt.setString(2,itemCode);
pstmt.setString(3,unit);
pstmt.setString(4,listType);
pstmt.setTimestamp(5,effFrom);
pstmt.setTimestamp(6,validUpto);
pstmt.setString(7,lotNoFrom);
pstmt.setString(8,lotNoTo);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
......
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