Commit dd7fd80f authored by manohar's avatar manohar

Speed optimisation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104393 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b0e660b8
......@@ -3866,23 +3866,34 @@ public class PostOrderActivity {
//Added by Santosh on 04/01/17 to add Invoice Id in the doc key [End]
else if (lsColnameStr.trim().equalsIgnoreCase("lot_no") || lsColnameStr.trim().equalsIgnoreCase("item_code"))
{
if ("R".equalsIgnoreCase(tranType))
if ( lsColnameStr.trim().equalsIgnoreCase("item_code"))
{
lsSelectSql = "select " + lsColnameStr + " from sreturndet where tran_id = '" + invoiceId + "'" + " and line_no = " + refLineNo + " and lot_no ='" + lotNo + " and item_code ='" + itemCode + "'";
} else
xFldValue = itemCode;
}
else if ( lsColnameStr.trim().equalsIgnoreCase("lot_no"))
{
lsSelectSql = "select " + lsColnameStr + " from invoice_trace where invoice_id = '" + invoiceId + "'" + " and sord_line_no = " + refLineNo + " and lot_no ='" + lotNo + "'" + " and item_code ='" + itemCode + "' and item_code__ord = '" + itemCodeOrd + "' and sord_no ='" + refNo + "'";
xFldValue = lotNo;
}
pstmt2 = conn.prepareStatement(lsSelectSql);
rs2 = pstmt2.executeQuery();
if (rs2.next())
else
{
xFldValue = checkNull(rs2.getString(1));
if ("R".equalsIgnoreCase(tranType))
{
lsSelectSql = "select " + lsColnameStr + " from sreturndet where tran_id = '" + invoiceId + "'" + " and line_no = " + refLineNo + " and lot_no ='" + lotNo + " and item_code ='" + itemCode + "'";
} else
{
lsSelectSql = "select " + lsColnameStr + " from invoice_trace where invoice_id = '" + invoiceId + "'" + " and sord_line_no = " + refLineNo + " and lot_no ='" + lotNo + "'" + " and item_code ='" + itemCode + "' and item_code__ord = '" + itemCodeOrd + "' and sord_no ='" + refNo + "'";
}
pstmt2 = conn.prepareStatement(lsSelectSql);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
xFldValue = checkNull(rs2.getString(1));
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
if ("I".equalsIgnoreCase(tranType) && periodScheme) // 06-Dec-16 manoharan periodScheme boolean variable considered to avoid checking for all item if no period scheme
{
......@@ -3998,6 +4009,7 @@ public class PostOrderActivity {
if (lsItemCodeparent != null && lsItemCodeparent.trim().length() > 0)
{
/* 17-jan-17 manoharan already taken out side
sql = "select order_type, state_code__dlv, count_code__dlv from sorder where sale_order = ?";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, refNo);
......@@ -4012,7 +4024,7 @@ public class PostOrderActivity {
pstmt2 = null;
rs2.close();
rs2 = null;
*/
lsSchemeCode = checkScheme(lsItemCodeparent, lsOrderType, custCode, siteCode, lsStateCode, lsCountCode, tranDate, conn);
if (lsSchemeCode != null && lsSchemeCode.trim().length() > 0)
......
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