Commit e37286bc authored by msharma's avatar msharma

Add Validation not to delete Workorder for mfgType=O


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@29943 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 99d4720e
...@@ -4084,7 +4084,8 @@ private String bomExplode(String siteCode, String bomCode) throws ITMException ...@@ -4084,7 +4084,8 @@ private String bomExplode(String siteCode, String bomCode) throws ITMException
private String deleteOldPlan(String siteCode, String itemCode) throws ITMException, Exception private String deleteOldPlan(String siteCode, String itemCode) throws ITMException, Exception
{ {
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs=null;
String mfgType="";
String sqlMpsOrder, sqlWorkOrder; String sqlMpsOrder, sqlWorkOrder;
String sqlIndent; String sqlIndent;
String sqlDistDemand; String sqlDistDemand;
...@@ -4133,6 +4134,20 @@ private String bomExplode(String siteCode, String bomCode) throws ITMException ...@@ -4133,6 +4134,20 @@ private String bomExplode(String siteCode, String bomCode) throws ITMException
System.out.println("Rows Deleted in MpsOrder :" + rowsDeleted); System.out.println("Rows Deleted in MpsOrder :" + rowsDeleted);
conn.commit(); conn.commit();
pstmt.close(); pstmt.close();
pstmt=conn.prepareStatement("select mfg_type from siteitem where site_code=? and item_code=? ");
pstmt.setString(1,siteCode);
pstmt.setString(2,itemCode);
rs=pstmt.executeQuery();
while(rs.next())
{
mfgType=rs.getString(1);
}
rs.close();
rs=null;
pstmt.close();
pstmt=null;
if(mfgType!=null && (!(mfgType.trim()).equalsIgnoreCase("O")))
{
pstmt = conn.prepareStatement(sqlWorkOrder); pstmt = conn.prepareStatement(sqlWorkOrder);
pstmt.setString(1,siteCode); pstmt.setString(1,siteCode);
pstmt.setString(2,itemCode); pstmt.setString(2,itemCode);
...@@ -4141,6 +4156,7 @@ private String bomExplode(String siteCode, String bomCode) throws ITMException ...@@ -4141,6 +4156,7 @@ private String bomExplode(String siteCode, String bomCode) throws ITMException
conn.commit(); conn.commit();
pstmt.close(); pstmt.close();
} }
}
if (disPlan.equals("Y")) if (disPlan.equals("Y"))
{ {
......
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