Commit 20f1a21b 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@43510 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0626fbe7
...@@ -169,9 +169,10 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC ...@@ -169,9 +169,10 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
System.out.println("-------- inside ind_date -----------------"); System.out.println("-------- inside ind_date -----------------");
mdate1 = checkNullAndTrim(genericUtility.getColumnValue("ind_date", dom)); mdate1 = checkNullAndTrim(genericUtility.getColumnValue("ind_date", dom));
mval = checkNullAndTrim(genericUtility.getColumnValue("site_code__ori", dom)); mval = checkNullAndTrim(genericUtility.getColumnValue("site_code__ori", dom));
Date ind_date = sdf.parse(mdate1); //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);
count = currDate.compareTo(ind_date);
if(mdate1.length() == 0) if(mdate1.length() == 0)
{ {
errCode = "VTINDDATE"; errCode = "VTINDDATE";
...@@ -180,6 +181,9 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC ...@@ -180,6 +181,9 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
} }
else if(mdate1.length() > 0) else if(mdate1.length() > 0)
{ {
Date ind_date = sdf.parse(mdate1);
count = currDate.compareTo(ind_date);
if(count > 1 && "A".equalsIgnoreCase(editFlag)) if(count > 1 && "A".equalsIgnoreCase(editFlag))
{ {
errCode = "VTLESSDATE"; errCode = "VTLESSDATE";
...@@ -592,6 +596,9 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC ...@@ -592,6 +596,9 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
System.out.println("-------- inside task_code -----------------"); System.out.println("-------- inside task_code -----------------");
mval = checkNullAndTrim(genericUtility.getColumnValue("task_code", dom)); mval = checkNullAndTrim(genericUtility.getColumnValue("task_code", dom));
//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 = ? "; sql = " SELECT COUNT(*) FROM PROJ_EST_MILESTONE WHERE TASK_CODE = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mval); pstmt.setString(1, mval);
...@@ -618,6 +625,7 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC ...@@ -618,6 +625,7 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
}
if("pind_apprv".equalsIgnoreCase(childNodeName)) if("pind_apprv".equalsIgnoreCase(childNodeName))
{ {
...@@ -2446,6 +2454,29 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC ...@@ -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; break;
...@@ -3993,6 +4024,8 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC ...@@ -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: 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)); 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 = ? "; sql = "SELECT TRACK_SHELF_LIFE, QC_REQD FROM ITEM WHERE ITEM_CODE = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -4027,8 +4060,12 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC ...@@ -4027,8 +4060,12 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
pstmt.setString(1, mval); pstmt.setString(1, mval);
pstmt.setString(2, msite_del); pstmt.setString(2, msite_del);
pstmt.setString(3, "Y"); pstmt.setString(3, "Y");
pstmt.setString(4, ld_ind_date); //Changed by wasim on 07-APR-17 for setting pstmt into Timestamp [START]
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));
//Changed by wasim on 07-APR-17 for setting pstmt into Timestamp [END]
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -4055,8 +4092,10 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC ...@@ -4055,8 +4092,10 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
pstmt.setString(1, mval); pstmt.setString(1, mval);
pstmt.setString(2, msite_del); pstmt.setString(2, msite_del);
pstmt.setString(3, "Y"); pstmt.setString(3, "Y");
pstmt.setString(4, ld_ind_date); //pstmt.setString(4, ld_ind_date);
pstmt.setString(5, 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(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -4140,7 +4179,17 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC ...@@ -4140,7 +4179,17 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
valueXmlString.append( "<purc_rate><![CDATA[" ).append(ld_last_purrate).append( "]]></purc_rate>\r\n" ); // Apprx Rate : 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><![CDATA[" ).append(lc_qty1).append( "]]></quantity>\r\n" );
valueXmlString.append( "<quantity__stduom><![CDATA[" ).append(tempQty).append( "]]></quantity__stduom>\r\n" ); // Std Qty : 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: //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_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_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: valueXmlString.append( "<emp_lname><![CDATA[" ).append(ls_lname).append( "]]></emp_lname>\r\n" ); // QC Approvar last name:
...@@ -4543,8 +4592,8 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC ...@@ -4543,8 +4592,8 @@ public class IndentReqIC extends ValidatorEJB implements IndentICLocal, IndentIC
} }
catch (Exception e) catch (Exception e)
{ {
System.out.println("Exception inside Item change IndentReqIC==>"+e.getMessage());
e.printStackTrace(); e.printStackTrace();
} }
finally 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