Commit c900f22c authored by skumbhar's avatar skumbhar

added instance id filter in query


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98385 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5be78ebc
...@@ -36,6 +36,10 @@ public class PurchaseMilestoneWF ...@@ -36,6 +36,10 @@ public class PurchaseMilestoneWF
String prvActivityId = ""; String prvActivityId = "";
boolean flag = true; boolean flag = true;
processInfo = processId.split(":");
prvActivityId = processInfo[2];
System.out.println("prvActivityId["+prvActivityId+"],activityId["+activityId+"]");
if("CHKUSRCOND".equalsIgnoreCase(keyFlag)) if("CHKUSRCOND".equalsIgnoreCase(keyFlag))
{ {
ArrayList<String> list = new ArrayList<String>(); ArrayList<String> list = new ArrayList<String>();
...@@ -46,20 +50,17 @@ public class PurchaseMilestoneWF ...@@ -46,20 +50,17 @@ public class PurchaseMilestoneWF
list.add("PNFRST_SIGN"); list.add("PNFRST_SIGN");
list.add("PNTHRD_SIGN"); list.add("PNTHRD_SIGN");
processInfo = processId.split(":");
prvActivityId = processInfo[2];
System.out.println("prvActivityId["+prvActivityId+"],activityId["+activityId+"]");
sql = "select previous_activity, seq_id " sql = "select previous_activity, seq_id "
+"from wf_prc_status " +"from wf_prc_status "
+"where ltrim(rtrim(ref_ser)) = ? and ltrim(rtrim(ref_id)) = ? " +"where ltrim(rtrim(ref_ser)) = ? and ltrim(rtrim(ref_id)) = ? "
+"and activity_id = ? and seq_id = ?"; +"and activity_id = ? and seq_id = ? and instance_id = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "U-REC"); pstmt.setString(1, "U-REC");
pstmt.setString(2, tranId); pstmt.setString(2, tranId);
pstmt.setString(3, prvActivityId); pstmt.setString(3, prvActivityId);
pstmt.setString(4, processInfo[3]); pstmt.setString(4, processInfo[3]);
pstmt.setString(5, processInfo[1]);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
...@@ -89,7 +90,7 @@ public class PurchaseMilestoneWF ...@@ -89,7 +90,7 @@ public class PurchaseMilestoneWF
+"select previous_activity, seq_id " +"select previous_activity, seq_id "
+"from wf_prc_status " +"from wf_prc_status "
+"where ltrim(rtrim(ref_ser)) = ? and ltrim(rtrim(ref_id)) = ? " +"where ltrim(rtrim(ref_ser)) = ? and ltrim(rtrim(ref_id)) = ? "
+"and activity_id = ? and seq_id <> 1 " +"and activity_id = ? and seq_id <> 1 and instance_id = ? "
+"order by seq_id desc " +"order by seq_id desc "
+") tab " +") tab "
+"where rownum = 1"; +"where rownum = 1";
...@@ -98,6 +99,7 @@ public class PurchaseMilestoneWF ...@@ -98,6 +99,7 @@ public class PurchaseMilestoneWF
pstmt.setString(1, "U-REC"); pstmt.setString(1, "U-REC");
pstmt.setString(2, tranId); pstmt.setString(2, tranId);
pstmt.setString(3, prvActivityId); pstmt.setString(3, prvActivityId);
pstmt.setString(4, processInfo[1]);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
...@@ -133,12 +135,13 @@ public class PurchaseMilestoneWF ...@@ -133,12 +135,13 @@ public class PurchaseMilestoneWF
sql = "select count(*) " sql = "select count(*) "
+"from wf_prc_status " +"from wf_prc_status "
+"where ltrim(rtrim(ref_ser)) = ? and ltrim(rtrim(ref_id)) = ? " +"where ltrim(rtrim(ref_ser)) = ? and ltrim(rtrim(ref_id)) = ? "
+"and activity_id = ?"; +"and activity_id = ? and instance_id = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "U-REC"); pstmt.setString(1, "U-REC");
pstmt.setString(2, tranId); pstmt.setString(2, tranId);
pstmt.setString(3, "SCND_SIGN"); pstmt.setString(3, "SCND_SIGN");
pstmt.setString(4, processInfo[1]);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
...@@ -167,12 +170,13 @@ public class PurchaseMilestoneWF ...@@ -167,12 +170,13 @@ public class PurchaseMilestoneWF
sql = "select count(*) " sql = "select count(*) "
+"from wf_prc_status " +"from wf_prc_status "
+"where ltrim(rtrim(ref_ser)) = ? and ltrim(rtrim(ref_id)) = ? " +"where ltrim(rtrim(ref_ser)) = ? and ltrim(rtrim(ref_id)) = ? "
+"and activity_id = ?"; +"and activity_id = ? and instance_id = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "U-REC"); pstmt.setString(1, "U-REC");
pstmt.setString(2, tranId); pstmt.setString(2, tranId);
pstmt.setString(3, "PNSC"); pstmt.setString(3, "PNSCND_SIGN");
pstmt.setString(4, processInfo[1]);
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