Commit 45fd9a62 authored by wansari's avatar wansari

W16IBAS007 updated source for QC issues


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@105289 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 973a2ab5
......@@ -169,9 +169,10 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
System.out.println("-------- inside ind_date -----------------");
mdate1 = checkNullAndTrim(genericUtility.getColumnValue("ind_date", dom));
mval = checkNullAndTrim(genericUtility.getColumnValue("site_code__ori", dom));
Date ind_date = sdf.parse(mdate1);
count = currDate.compareTo(ind_date);
//Changed by wasim on 06-04-2017 if indent date is blank then it will give error so commented.
//Date ind_date = sdf.parse(mdate1);
//count = currDate.compareTo(ind_date);
if(mdate1.length() == 0)
{
errCode = "VTINDDATE";
......@@ -180,6 +181,9 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
}
else if(mdate1.length() > 0)
{
Date ind_date = sdf.parse(mdate1);
count = currDate.compareTo(ind_date);
if(count > 1 && "A".equalsIgnoreCase(editFlag))
{
errCode = "VTLESSDATE";
......@@ -592,31 +596,35 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
System.out.println("-------- inside task_code -----------------");
mval = checkNullAndTrim(genericUtility.getColumnValue("task_code", dom));
sql = " SELECT COUNT(*) FROM PROJ_EST_MILESTONE WHERE TASK_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mval);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(cnt == 0)
{
errCode = "VTTASK1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
//Added by wasim on 07-APR-17 if task code is present then only validate
if(mval.length() > 0)
{
sql = " SELECT COUNT(*) FROM PROJ_EST_MILESTONE WHERE TASK_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mval);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(cnt == 0)
{
errCode = "VTTASK1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
if("pind_apprv".equalsIgnoreCase(childNodeName))
......@@ -2446,6 +2454,29 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
}
}
}
//Changed by wasim on 07-APR-2017 for consumption date validation [START]
if("exp_cons_date".equalsIgnoreCase(childNodeName))
{
Timestamp date1 = null, date2 = null;
String reqDate = "",expConsDate = "";
reqDate = checkNullAndTrim(genericUtility.getColumnValue("req_date", dom));
expConsDate = checkNullAndTrim(genericUtility.getColumnValue("exp_cons_date", dom));
if(expConsDate.length() > 0)
{
date1 = Timestamp.valueOf(genericUtility.getValidDateString( reqDate , genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");;
date2 = Timestamp.valueOf(genericUtility.getValidDateString( expConsDate , genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");;
if(date2.before(date1))
{
errCode = "VTCONSDATE";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
//Changed by wasim on 07-APR-2017 for consumption date validation [END]
}
break;
......@@ -3993,6 +4024,8 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
valueXmlString.append( "<supp_code__pref><![CDATA[" ).append(ls_supp_pref).append( "]]></supp_code__pref>\r\n" ); // Pref Supplier:
ld_ind_date = checkNullAndTrim(genericUtility.getColumnValue("ind_date", hdrDataDom));
//Added by wasim on 07-apr-2017 for getting indent date in DB formate
String indDateStr = genericUtility.getValidDateTimeString(checkNullAndTrim(ld_ind_date), genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat());
sql = "SELECT TRACK_SHELF_LIFE, QC_REQD FROM ITEM WHERE ITEM_CODE = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -4027,8 +4060,12 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
pstmt.setString(1, mval);
pstmt.setString(2, msite_del);
pstmt.setString(3, "Y");
pstmt.setString(4, ld_ind_date);
pstmt.setString(5, ld_ind_date);
//Changed by wasim on 07-APR-17 for setting pstmt into Timestamp [START]
//pstmt.setString(4, ld_ind_date);
//pstmt.setString(5, ld_ind_date);
pstmt.setTimestamp(4, java.sql.Timestamp.valueOf(indDateStr));
pstmt.setTimestamp(5, java.sql.Timestamp.valueOf(indDateStr));
//Changed by wasim on 07-APR-17 for setting pstmt into Timestamp [END]
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -4055,8 +4092,10 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
pstmt.setString(1, mval);
pstmt.setString(2, msite_del);
pstmt.setString(3, "Y");
pstmt.setString(4, ld_ind_date);
pstmt.setString(5, ld_ind_date);
//pstmt.setString(4, ld_ind_date);
//pstmt.setString(5, ld_ind_date);
pstmt.setTimestamp(4, java.sql.Timestamp.valueOf(indDateStr));
pstmt.setTimestamp(5, java.sql.Timestamp.valueOf(indDateStr));
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -4139,8 +4178,18 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
valueXmlString.append( "<quantity_atsite><![CDATA[" ).append(qty1).append( "]]></quantity_atsite>\r\n" ); // Stock at Site:
valueXmlString.append( "<purc_rate><![CDATA[" ).append(ld_last_purrate).append( "]]></purc_rate>\r\n" ); // Apprx Rate :
valueXmlString.append( "<quantity><![CDATA[" ).append(lc_qty1).append( "]]></quantity>\r\n" );
valueXmlString.append( "<quantity__stduom><![CDATA[" ).append(tempQty).append( "]]></quantity__stduom>\r\n" ); // Std Qty :
valueXmlString.append( "<emp_code__qcaprv><![CDATA[" ).append(ls_emp_code__qcaprv).append( "]]></emp_code__qcaprv>\r\n" ); // QC Approvar:
valueXmlString.append( "<quantity__stduom><![CDATA[" ).append(tempQty).append( "]]></quantity__stduom>\r\n" ); // Std Qty :
//Changed by wasim on 07-APR-17 if QC_REQD is Y then QC approver field should be editable [START]
//valueXmlString.append( "<emp_code__qcaprv><![CDATA[" ).append(ls_emp_code__qcaprv).append( "]]></emp_code__qcaprv>\r\n" ); // QC Approvar:
if("Y".equals(ls_qc_reqd))
{
valueXmlString.append( "<emp_code__qcaprv protect = '0'><![CDATA[" ).append(ls_emp_code__qcaprv).append( "]]></emp_code__qcaprv>\r\n" ); // QC Approvar:
}
else
{
valueXmlString.append( "<emp_code__qcaprv protect = '1'><![CDATA[" ).append(ls_emp_code__qcaprv).append( "]]></emp_code__qcaprv>\r\n" );
}
//Changed by wasim on 07-APR-17 if QC_REQD is Y then QC approver field should be editable [END]
valueXmlString.append( "<emp_fname><![CDATA[" ).append(ls_fname).append( "]]></emp_fname>\r\n" ); // QC Approvar First name:
valueXmlString.append( "<emp_mname><![CDATA[" ).append(ls_mname).append( "]]></emp_mname>\r\n" ); // QC Approvar middle name:
valueXmlString.append( "<emp_lname><![CDATA[" ).append(ls_lname).append( "]]></emp_lname>\r\n" ); // QC Approvar last name:
......@@ -4542,9 +4591,9 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
valueXmlString.append( "</Root>\r\n" );
}
catch (Exception e)
{
e.printStackTrace();
{
System.out.println("Exception inside Item change IndentReqIC==>"+e.getMessage());
e.printStackTrace();
}
finally
{
......
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