Commit 73cdf48c authored by manohar's avatar manohar

consider lot no issue


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91588 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d3e7b9f7
......@@ -276,7 +276,7 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
PreparedStatement pstmt = null;
ResultSet rs = null;
Connection conn = null;
String lotNo = "", lotSl = "";
String lotNo = "", lotSl = "", lotNoIssue = "", considerLotNoIssue = "N";
StringBuffer sqlSB = new StringBuffer();
StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n");
......@@ -299,7 +299,46 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
expLev = genericUtility.getColumnValue("exp_lev", dom);
operation = Integer.parseInt(genericUtility.getColumnValue("operation", dom1));
bomCode = genericUtility.getColumnValue("bom_code", dom1);
// 18/02/12 manoharan
sql = "select w.LOT_NO__ISSUE,b.CONSIDER_LOT_NO__ISSUE from workorder w, workorder_bill b "
+ " where w.work_order = b.work_order "
+ " and w.work_order = ? "
+ " and b.emp_lev = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, workOrder);
pstmt.setString(2, expLev);
rs = pstmt.executeQuery();
if (rs.next())
{
lotNoIssue = rs.getString("LOT_NO__ISSUE");
considerLotNoIssue = rs.getString("CONSIDER_LOT_NO__ISSUE");
}
pstmt.close();
rs.close();
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
String lotNoList[];
String lotNoIssueTemp = "";
lotNoList = lotNoIssue.split(",");
lotNoIssue = "";
for(int ctr = 0;ctr < lotNoList.length;ctr++)
{
lotNoIssueTemp = lotNoList[ctr];
if (lotNoIssue.trim().length() > 0)
{
lotNoIssue = lotNoIssue + ",'".concat(lotNoIssueTemp).concat("'");
}
else
{
lotNoIssue = lotNoIssue + "'".concat(lotNoIssueTemp).concat("'");
}
}
}
// end 18/02/12 manoharan
// for qc_reqd to be checked from first siteitem & then item
qcReqd = mfgCommon.chkQcReqd(siteCode, itemCode, conn);
autoQcReqd = mfgCommon.chkAutoQcReqd(siteCode, itemCode, conn);
......@@ -367,7 +406,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " AND ((CASE WHEN A.QUANTITY IS NULL THEN 0 ELSE A.QUANTITY END) - "
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 "
+ " AND ( A.EXP_DATE > ? OR A.EXP_DATE IS NULL) AND A.RETEST_DATE > ?";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -382,6 +426,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " AND ((CASE WHEN A.QUANTITY IS NULL THEN 0 ELSE A.QUANTITY END) - "
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 "
+ " AND (A.EXP_DATE > ? OR A.EXP_DATE IS NULL)";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -395,6 +445,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " AND ((CASE WHEN A.QUANTITY IS NULL THEN 0 ELSE A.QUANTITY END) - "
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 "
+ " AND (A.EXP_DATE > ? OR A.EXP_DATE IS NULL) ";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -408,6 +464,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " AND ((CASE WHEN A.QUANTITY IS NULL THEN 0 ELSE A.QUANTITY END) - "
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 "
+ " AND A.RETEST_DATE > ? ";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -420,6 +482,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " AND A.SITE_CODE = ? AND C.AVAILABLE = 'Y' "
+ " AND ((CASE WHEN A.QUANTITY IS NULL THEN 0 ELSE A.QUANTITY END) - "
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 ";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -431,6 +499,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " AND A.SITE_CODE = ? AND C.AVAILABLE = 'Y' "
+ " AND ((CASE WHEN A.QUANTITY IS NULL THEN 0 ELSE A.QUANTITY END) - "
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 ";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -443,6 +517,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " AND ((CASE WHEN A.QUANTITY IS NULL THEN 0 ELSE A.QUANTITY END) - "
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 "
+ " AND DDF_COMPARE_DIMENSION(CASE WHEN A.DIMENSION IS NULL THEN ' ' ELSE A.DIMENSION END, ?, ?) = 'Y'";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -456,6 +536,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " AND A.SITE_CODE = ? AND C.STAT_TYPE <> 'S' "
+ " AND ((CASE WHEN A.QUANTITY IS NULL THEN 0 ELSE A.QUANTITY END) - "
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 ";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -468,6 +554,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " AND ((CASE WHEN A.QUANTITY IS NULL THEN 0 ELSE A.QUANTITY END) - "
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 "
+ " AND (A.EXP_DATE > ? OR A.EXP_DATE IS NULL) ";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -500,6 +592,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 "
+ " AND ( A.EXP_DATE > ? OR A.EXP_DATE IS NULL) AND A.RETEST_DATE > ?"
+ " AND DDF_COMPARE_DIMENSION(CASE WHEN A.DIMENSION IS NULL THEN ' ' ELSE A.DIMENSION END, ?, ?) = 'Y'";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -518,6 +616,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " AND (A.EXP_DATE > ? OR A.EXP_DATE IS NULL)"
+ " AND DDF_COMPARE_DIMENSION(CASE WHEN A.DIMENSION IS NULL THEN ' ' ELSE A.DIMENSION END, ?, ?) = 'Y'";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -534,6 +638,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 "
+ " AND (A.EXP_DATE > ? OR A.EXP_DATE IS NULL) "
+ " AND DDF_COMPARE_DIMENSION(CASE WHEN A.DIMENSION IS NULL THEN ' ' ELSE A.DIMENSION END, ?, ?) = 'Y'";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -550,6 +660,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 "
+ " AND A.RETEST_DATE > ? "
+ " AND DDF_COMPARE_DIMENSION(CASE WHEN A.DIMENSION IS NULL THEN ' ' ELSE A.DIMENSION END, ?, ?) = 'Y'";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -565,6 +681,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " AND ((CASE WHEN A.QUANTITY IS NULL THEN 0 ELSE A.QUANTITY END) - "
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 "
+ " AND DDF_COMPARE_DIMENSION(CASE WHEN A.DIMENSION IS NULL THEN ' ' ELSE A.DIMENSION END, ?, ?) = 'Y'";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -579,6 +701,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " AND ((CASE WHEN A.QUANTITY IS NULL THEN 0 ELSE A.QUANTITY END) - "
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 "
+ " AND DDF_COMPARE_DIMENSION(CASE WHEN A.DIMENSION IS NULL THEN ' ' ELSE A.DIMENSION END, ?, ?) = 'Y'";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -593,6 +721,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " AND ((CASE WHEN A.QUANTITY IS NULL THEN 0 ELSE A.QUANTITY END) - "
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 "
+ " AND DDF_COMPARE_DIMENSION(CASE WHEN A.DIMENSION IS NULL THEN ' ' ELSE A.DIMENSION END, ?, ?) = 'Y'";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -607,6 +741,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " AND ((CASE WHEN A.QUANTITY IS NULL THEN 0 ELSE A.QUANTITY END) - "
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 "
+ " AND DDF_COMPARE_DIMENSION(CASE WHEN A.DIMENSION IS NULL THEN ' ' ELSE A.DIMENSION END, ?, ?) = 'Y'";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -622,6 +762,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
+ " (CASE WHEN A.ALLOC_QTY IS NULL THEN 0 ELSE A.ALLOC_QTY END)) > 0 "
+ " AND (A.EXP_DATE > ? OR A.EXP_DATE IS NULL) "
+ " AND DDF_COMPARE_DIMENSION(CASE WHEN A.DIMENSION IS NULL THEN ' ' ELSE A.DIMENSION END, ?, ?) = 'Y'";
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -715,6 +861,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
}
sql = sqlSB.toString();
// 18/02/12 manoharan
if ("Y".equals(considerLotNoIssue) && lotNoIssue != null && !"null".equals(lotNoIssue) && lotNoIssue.trim().length() > 0)
{
sql = sql + " AND A.LOT_NO IN (" + lotNoIssue + ") ";
}
// end 18/02/12 manoharan
System.out.println("sqlSB converted ::: "+ sql);
StringTokenizer st = new StringTokenizer(sql, "?");
......
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