Commit 1e95a822 authored by cpandey's avatar cpandey

added condition for track self life


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91811 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 43fb0d56
......@@ -13,7 +13,6 @@ import java.io.ByteArrayOutputStream;
import java.io.Serializable;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
......@@ -23,8 +22,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.StringTokenizer;
import java.text.DecimalFormat;
import javax.ejb.CreateException;
import javax.ejb.SessionBean;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
......@@ -51,10 +48,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
public void ejbPassivate() {
}*/
CommonConstants commonConstants = new CommonConstants();
@Override
public String actionHandler() throws RemoteException, ITMException {
return "";
}
@Override
public String actionHandler(String actionType, String xmlString,
String xmlString1, String objContext, String xtraParams)
throws RemoteException, ITMException {
......@@ -97,6 +96,7 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
return retString;
}
@Override
public String actionHandlerTransform(String actionType, String xmlString,
String xmlString1, String objContext, String xtraParams,
String selDataStr) throws RemoteException, ITMException {
......@@ -183,7 +183,7 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
{
sql = "SELECT EXP_LEV, ITEM_CODE, QUANTITY FROM WORKORDER_ISSDET_REQ WHERE TRAN_ID = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranIdReq);
pstmt.setString(1,tranIdReq);
rs = pstmt.executeQuery();
while (rs.next())
{
......@@ -430,7 +430,7 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
}
else if (qcReqd.equalsIgnoreCase("Y") && autoQcReqd.equalsIgnoreCase("N") && trackShelfLife.equalsIgnoreCase("Y") && useInvStatus.equalsIgnoreCase("U"))
{
sql = " SELECT COUNT(A.ITEM_CODE) FROM STOCK A, LOCATION B, INVSTAT C "
sql = "SELECT COUNT(A.ITEM_CODE) FROM STOCK A, LOCATION B, INVSTAT C "
+ " WHERE A.LOC_CODE = B.LOC_CODE AND B.INV_STAT = C.INV_STAT "
+ " AND A.ITEM_CODE = ? AND A.SITE_CODE = ? AND C.AVAILABLE = 'Y' "
+ " AND ((CASE WHEN A.QUANTITY IS NULL THEN 0 ELSE A.QUANTITY END) - "
......@@ -455,12 +455,12 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
}
else if (qcReqd.equalsIgnoreCase("N") && trackShelfLife.equalsIgnoreCase("Y") && useInvStatus.equalsIgnoreCase("U"))
{
sql = " SELECT COUNT(A.ITEM_CODE) FROM STOCK A, LOCATION B, INVSTAT C "
+ " WHERE A.LOC_CODE = B.LOC_CODE AND B.INV_STAT = C.INV_STAT AND A.ITEM_CODE = ? "
+ " 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 "
+ " AND (A.EXP_DATE > ? OR A.EXP_DATE IS NULL) ";
sql = "SELECT COUNT(A.ITEM_CODE) FROM STOCK A, LOCATION B, INVSTAT C "
+ "WHERE A.LOC_CODE = B.LOC_CODE AND B.INV_STAT = C.INV_STAT AND A.ITEM_CODE = ? "
+ "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 "
+ "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)
{
......@@ -986,19 +986,37 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
}
// end 26/03/12 manoharan
// 02/04/12 manoharan sorting to be doen as per PB logic
sql = sql + " order by partial_used, (case when '" + locUsageType + "' = 'P' then (case when rtrim(c.loc_group) = rtrim('" + locGroup + "') Then 'A' else 'B' end) else '0' end), " ;
if ("db2".equalsIgnoreCase(commonConstants.DB_NAME))
//changes by cpandey additin condition for track shelf life on 20/08/12
if("N".equalsIgnoreCase(trackShelfLife))
{
sql = sql + " order by partial_used,decode('N','P',decode(rtrim(location.loc_group),rtrim(''),'A','B'),'0'), " ;
System.out.println("sql If track self life is N ["+sql+"]>>");
}
if("Y".equalsIgnoreCase(trackShelfLife))
{
sql = sql + " order by partial_used,decode('N','P',decode(rtrim(location.loc_group),rtrim(''),'A','B'),'0'), " ;
System.out.println("sql sql If track self life is Y--["+sql+"]>>");
}
//end of changes on 20/08/12
//commented by cpandey
//sql = sql + " order by partial_used, (case when '" + locUsageType + "' = 'P' then (case when rtrim(c.loc_group) = rtrim('" + locGroup + "') Then 'A' else 'B' end) else '0' end), " ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME))
{
sql = sql + " nvl(a.exp_date,a.crea_date),a.crea_date,a.lot_no ";
}
else
{
sql = sql + " nvl(a.exp_date,a.crea_date),a.crea_date,a.lot_no, "
+ " decode(length(decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) , 'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) - 1)) ,rtrim(a.lot_sl)) ), "
+ " 1, '00' || decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) , 'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) )) ,rtrim(a.lot_sl)), "
+ " decode(length(decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) ," +
" 'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) - 1)) ,rtrim(a.lot_sl)) ), "
+ " 1, '00' || decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) , " +
"'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) )) ,rtrim(a.lot_sl)), "
+" decode(length(decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) , 'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) - 1)) ,rtrim(a.lot_sl)) ), "
+ " 2, '0' || decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) , 'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) )) ,rtrim(a.lot_sl)), "
+" decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) , 'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) - 1)) ,rtrim(a.lot_sl)) )) ";
+" decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) ," +
" 'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) - 1)) ,rtrim(a.lot_sl)) )) ";
}
// end 02/04/12 manoharan
......@@ -2950,6 +2968,7 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
}
return retVal;
}
@Override
public ArrayList getDetails(String woCode) throws ITMException
{
PreparedStatement pstmt = null, pstmt1 = null;
......
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