Commit f4d9340b authored by manohar's avatar manohar

where clause changed to work_order instead of tran_id


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92283 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7b15556a
...@@ -137,8 +137,9 @@ public class WorkOrderAmd extends ValidatorEJB implements WorkOrderAmdLocal, W ...@@ -137,8 +137,9 @@ public class WorkOrderAmd extends ValidatorEJB implements WorkOrderAmdLocal, W
{ {
siteCode = getColumnValue("site_code",dom); siteCode = getColumnValue("site_code",dom);
siteCode = siteCode == null ? "" : siteCode; siteCode = siteCode == null ? "" : siteCode;
sql = "Select count(*) from site where site_code ='"+siteCode+"'"; sql = "Select count(*) from site where site_code = ?;
pstmt= conn.prepareStatement(sql); pstmt= conn.prepareStatement(sql);
pstmt.setString(1,siteCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -158,9 +159,9 @@ public class WorkOrderAmd extends ValidatorEJB implements WorkOrderAmdLocal, W ...@@ -158,9 +159,9 @@ public class WorkOrderAmd extends ValidatorEJB implements WorkOrderAmdLocal, W
else if (childNodeName.equalsIgnoreCase("work_order__ref")) else if (childNodeName.equalsIgnoreCase("work_order__ref"))
{ {
tranIdRef = getColumnValue("work_order__ref",dom); tranIdRef = getColumnValue("work_order__ref",dom);
sql = "Select status from workorder where tran_id ='"+tranIdRef+"'"; sql = "Select status from workorder where work_order = ?";
System.out.println("Sql for status................:- " + sql);
pstmt= conn.prepareStatement(sql); pstmt= conn.prepareStatement(sql);
pstmt.setString(1,tranIdRef);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -173,7 +174,7 @@ public class WorkOrderAmd extends ValidatorEJB implements WorkOrderAmdLocal, W ...@@ -173,7 +174,7 @@ public class WorkOrderAmd extends ValidatorEJB implements WorkOrderAmdLocal, W
System.out.println("status>>>>>>>>>>>>>> " + status); System.out.println("status>>>>>>>>>>>>>> " + status);
if( status.equalsIgnoreCase("R") || status.equalsIgnoreCase("U")) if( status.equalsIgnoreCase("R") || status.equalsIgnoreCase("U"))
{ {
System.out.println("U r permited>>>>>>>>>>>>>> " + status); System.out.println("U R permited>>>>>>>>>>>>>> " + status);
} }
else else
{ {
...@@ -199,15 +200,11 @@ public class WorkOrderAmd extends ValidatorEJB implements WorkOrderAmdLocal, W ...@@ -199,15 +200,11 @@ public class WorkOrderAmd extends ValidatorEJB implements WorkOrderAmdLocal, W
else else
{ {
mfgDateStart = genericUtility.getValidDateString(mfgDateStart,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()); mfgDateStart = genericUtility.getValidDateString(mfgDateStart,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat());
System.out.println("mfgDateStart in dbdate format:- " + mfgDateStart);
System.out.println("mfgDateStart + 00:00:00.0 in dbdate format:- " + (mfgDateStart + " 00:00:00.0"));
mfgDateStartTs = Timestamp.valueOf(mfgDateStart + " 00:00:00.0"); mfgDateStartTs = Timestamp.valueOf(mfgDateStart + " 00:00:00.0");
System.out.println("mfgDateStart in Timestamp:- " + mfgDateStart); System.out.println("mfgDateStart in Timestamp:- " + mfgDateStart);
if(mfgDateStartOld != null && mfgDateStartOld.trim().length() > 0) if(mfgDateStartOld != null && mfgDateStartOld.trim().length() > 0)
{ {
mfgDateStartOld = genericUtility.getValidDateString(mfgDateStartOld,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()); mfgDateStartOld = genericUtility.getValidDateString(mfgDateStartOld,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat());
System.out.println("mfgDateStartOld in dbdate format:- " + mfgDateStartOld);
System.out.println("mfgDateStartOld + 00:00:00.0 in dbdate format:- " + (mfgDateStartOld + " 00:00:00.0"));
mfgDateStartOldTs = Timestamp.valueOf(mfgDateStartOld + " 00:00:00.0"); mfgDateStartOldTs = Timestamp.valueOf(mfgDateStartOld + " 00:00:00.0");
System.out.println("mfgDateStartOldTs in Timestamp:- " + mfgDateStartOldTs); System.out.println("mfgDateStartOldTs in Timestamp:- " + mfgDateStartOldTs);
if(mfgDateStartTs.compareTo(mfgDateStartOldTs) == 0) if(mfgDateStartTs.compareTo(mfgDateStartOldTs) == 0)
...@@ -223,13 +220,13 @@ public class WorkOrderAmd extends ValidatorEJB implements WorkOrderAmdLocal, W ...@@ -223,13 +220,13 @@ public class WorkOrderAmd extends ValidatorEJB implements WorkOrderAmdLocal, W
break; break;
} }
} }
if(mfgDateStartTs.before(getCurrdateAppFormat())) /*if(mfgDateStartTs.before(getCurrdateAppFormat()))
{ {
System.out.println("Previous day mfg date:"); System.out.println("Previous day mfg date:");
errCode = "VTWOMFMFT"; errCode = "VTWOMFMFT";
errString = getErrorString("start_time",errCode,userId); errString = getErrorString("start_time",errCode,userId);
break; break;
} }*/
} }
}//end mfg_date }//end mfg_date
else if (childNodeName.equalsIgnoreCase("exp_date")) else if (childNodeName.equalsIgnoreCase("exp_date"))
...@@ -336,13 +333,13 @@ public class WorkOrderAmd extends ValidatorEJB implements WorkOrderAmdLocal, W ...@@ -336,13 +333,13 @@ public class WorkOrderAmd extends ValidatorEJB implements WorkOrderAmdLocal, W
break; break;
} }
} }
if(planDueDateTs.before(getCurrdateAppFormat())) /*if(planDueDateTs.before(getCurrdateAppFormat()))
{ {
System.out.println("Previous day plan date:"); System.out.println("Previous day plan date:");
errCode = "VTWOMFPLT"; errCode = "VTWOMFPLT";
errString = getErrorString("start_time",errCode,userId); errString = getErrorString("start_time",errCode,userId);
break; break;
} }*/
}//plan__due_date not null }//plan__due_date not null
}// end plan__due_date }// end plan__due_date
// end proj_time // end proj_time
......
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