Commit 7a43285e authored by smestry's avatar smestry

Updated the java file for product wizard changes


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104056 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 13ba4a12
......@@ -248,7 +248,6 @@ public class ItemDetailsBean
// Changed by Sneha on 25-10-2016, for customer item reference flag [Start]
public String getCustItemRefFlag() throws ITMException
{
System.out.println("inside getCustItemRefFlag =======]");
String itemTypeList = "";
DDProductWizRemote ddProductWizRemote = null;
......@@ -259,7 +258,7 @@ public class ItemDetailsBean
ddProductWizRemote = (ibase.webitm.ejb.wms.DDProductWizRemote) ctx.lookup("ibase/DDProductWizEJB/remote");
itemTypeList = ddProductWizRemote.getCustItemRefFlagVal();
System.out.println("inside itemTypeList =====>>["+itemTypeList+"]");
System.out.println("getCustItemRefFlag =====>>["+itemTypeList+"]");
}
catch (Exception e)
{
......@@ -276,6 +275,96 @@ public class ItemDetailsBean
}
// Changed by Sneha on 25-10-2016, for customer item reference flag [End]
// Changed by Sneha on 23-11-2016, to default values flag [Start]
public String getDefaultValuesFlag() throws ITMException
{
String defaultValuesFlag = "";
DDProductWizRemote ddProductWizRemote = null;
try
{
InitialContext ctx = new InitialContext( new AppConnectParm().getProperty() );
ddProductWizRemote = (ibase.webitm.ejb.wms.DDProductWizRemote) ctx.lookup("ibase/DDProductWizEJB/remote");
defaultValuesFlag = ddProductWizRemote.defaultValueFlag();
System.out.println("getDefaultValuesFlag =====>>["+defaultValuesFlag+"]");
}
catch (Exception e)
{
throw new ITMException(e);
}
finally
{
if ( ddProductWizRemote != null )
{
ddProductWizRemote = null;
}
}
return defaultValuesFlag;
}
// Changed by Sneha on 23-11-2016, to default values flag [End]
// Changed by Sneha on 25-10-2016, for customer item reference flag [Start]
public String getDefaultBarcodeFlag() throws ITMException
{
String returnVal = "";
DDProductWizRemote ddProductWizRemote = null;
try
{
InitialContext ctx = new InitialContext( new AppConnectParm().getProperty() );
ddProductWizRemote = (ibase.webitm.ejb.wms.DDProductWizRemote) ctx.lookup("ibase/DDProductWizEJB/remote");
returnVal = ddProductWizRemote.getDefaultBarcodeFlagVal();
System.out.println("getCustItemRefFlag =====>>["+returnVal+"]");
}
catch (Exception e)
{
throw new ITMException(e);
}
finally
{
if ( ddProductWizRemote != null )
{
ddProductWizRemote = null;
}
}
return returnVal;
}
// Changed by Sneha on 25-10-2016, for customer item reference flag [End]
// Changed by Sneha on 25-10-2016, for customer item reference flag [Start]
public String defaultBarcodeVal(String userId) throws ITMException
{
String returnVal = "";
DDProductWizRemote ddProductWizRemote = null;
try
{
InitialContext ctx = new InitialContext( new AppConnectParm().getProperty() );
ddProductWizRemote = (ibase.webitm.ejb.wms.DDProductWizRemote) ctx.lookup("ibase/DDProductWizEJB/remote");
returnVal = ddProductWizRemote.generateTranId("w_barcode", userId, null);
System.out.println("defaultBarcodeVal =====>>["+returnVal+"]");
}
catch (Exception e)
{
throw new ITMException(e);
}
finally
{
if ( ddProductWizRemote != null )
{
ddProductWizRemote = null;
}
}
return returnVal;
}
// Changed by Sneha on 25-10-2016, for customer item reference flag [End]
/**
*
* @param input
......
package ibase.webitm.ejb.wms;
import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.TransIDGenerator;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
......@@ -21,6 +27,13 @@ import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import sun.security.action.GetBooleanAction;
/**
* Session Bean implementation class DDProductWizEJB
*/
......@@ -769,7 +782,7 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
String locCode = "";
String locDescr = "";
String locType = "";
String custItemRefVal = "", custItemRef = "";
String custItemRefVal = "", custItemRef = "", commodityNo = "", barcodeFlagVal = "";
try
{
//Changed and Commented By Santosh on 14-06-2016 :[START]
......@@ -950,6 +963,8 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
valueXmlString.append("<phy_attrib_4>").append("<![CDATA[]]>").append("</phy_attrib_4>\r\n");
//Changed by Sneha on 24-10-2016, to add new field customer item references [End]
valueXmlString.append("<item_commodity>").append("<![CDATA[]]>").append("</item_commodity>\r\n"); //Changed by Sneha on 24-11-2016, to add new field commodity no.
valueXmlString.append(getLanguages(conn));
}
valueXmlString.append("</Detail1>\r\n");
......@@ -964,6 +979,9 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
custItemRefVal = getCustItemRefFlagVal(); //Changed by Sneha on 24-10-2016, to add new field customer item references
//System.out.println("custItemRefVal =========>>"+custItemRefVal);
barcodeFlagVal = getDefaultBarcodeFlagVal();
System.out.println("barcodeFlagVal =========>>"+barcodeFlagVal);
String item_parnt = genericUtility.getColumnValue("item_parnt", dom1);
String item_parnt_desc = genericUtility.getColumnValue("item_parnt_desc", dom1);
String item_type = genericUtility.getColumnValue("item_type", dom1);
......@@ -1049,9 +1067,10 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
//Changed by Sneha on 24-10-2016, to add new field customer item references [Start]
custItemRef = genericUtility.getColumnValue("phy_attrib_4", dom1);
System.out.println("custItemRef=======>>"+custItemRef);
//Changed by Sneha on 24-10-2016, to add new field customer item references [End]
commodityNo = genericUtility.getColumnValue("item_commodity", dom1); // Changed by Sneha on 24-11-2016 for commodity no
valueXmlString.append("<Detail2 domID='0' selected = 'N'>\r\n");
if(currentColumn.equalsIgnoreCase("itm_default"))
......@@ -1153,7 +1172,8 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
//Changed by Sneha on 24-10-2016, to add new field customer item references [Start]
valueXmlString.append("<phy_attrib_4>").append("<![CDATA["+ checkNullAndTrim(custItemRef) +"]]>").append("</phy_attrib_4>\r\n");
//Changed by Sneha on 24-10-2016, to add new field customer item references [End]
valueXmlString.append("<item_commodity>").append("<![CDATA["+ checkNullAndTrim(commodityNo) +"]]>").append("</item_commodity>\r\n"); // Changed by Sneha on 24-11-2016, to display the value for commodity no
}
valueXmlString.append("</Detail2>\r\n");
......@@ -1197,7 +1217,7 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
}
// Changed by Sneha on 22-06-2016, for Dimension NA in item description [End]
custItemRefStr = item_parnt + color[j] + size1[k]; //Changed by Sneha on 24-10-2016, to add new field customer item references
custItemRefStr = item_parnt + " - " + color[j] + " - " + size1[k]; //Changed by Sneha on 24-10-2016, to add new field customer item references
valueXmlString.append("<Detail2 domID='"+ no +"' selected = 'Y'>\r\n");
......@@ -1219,7 +1239,7 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
valueXmlString.append("<item_width>").append("<![CDATA["+ checkNullAndTrim(item_width) +"]]>").append("</item_width>\r\n");
valueXmlString.append("<item_height>").append("<![CDATA["+ checkNullAndTrim(item_height) +"]]>").append("</item_height>\r\n");
valueXmlString.append("<item_gross_wt>").append("<![CDATA["+ checkNullAndTrim(item_gross_wt) +"]]>").append("</item_gross_wt>\r\n");
valueXmlString.append("<item_barcode>").append("<![CDATA[]]>").append("</item_barcode>\r\n");
//valueXmlString.append("<item_barcode>").append("<![CDATA[]]>").append("</item_barcode>\r\n");
//Added by Chetan Mahajan on date:06/02/2015 [Added purchase lead time,location description] Start
valueXmlString.append("<loc_code>").append("<![CDATA["+ checkNullAndTrim(loc_code) +"]]>").append("</loc_code>\r\n"); /*Added by Chetan Mahajan on date:05/02/2015..*/
valueXmlString.append("<loc_type>").append("<![CDATA["+ checkNullAndTrim(loc_type) +"]]>").append("</loc_type>\r\n"); /*Added by Chetan Mahajan on date:05/02/2015..*/
......@@ -1238,7 +1258,7 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
valueXmlString.append("<language_dtl>").append("<![CDATA["+ checkNullAndTrim(language_dtl) +"]]>").append("</language_dtl>\r\n");
valueXmlString.append("<tax>").append("<![CDATA["+ checkNullAndTrim(tax) +"]]>").append("</tax>\r\n");
valueXmlString.append("<tax_desc>").append("<![CDATA["+ checkNullAndTrim(tax_desc) +"]]>").append("</tax_desc>\r\n");
valueXmlString.append("<item_commodity>").append("<![CDATA[]]>").append("</item_commodity>\r\n");
valueXmlString.append("<item_commodity>").append("<![CDATA["+ checkNullAndTrim(commodityNo) +"]]>").append("</item_commodity>\r\n");
//Added by Parikshit Kumbhar on date 20/04/2015 [Added shipper_size, case_length, case_width,size_height, case_gross_weight, case_net_weight, pack_size_dtl,lang fields] Ends
valueXmlString.append("<price_list_dtl>").append("<![CDATA["+ checkNullAndTrim(price_list_dtl) +"]]>").append("</price_list_dtl>\r\n");
......@@ -1265,7 +1285,23 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
{
valueXmlString.append("<phy_attrib_4>").append("<![CDATA[]]>").append("</phy_attrib_4>\r\n");
}
//Changed by Sneha on 24-10-2016, to add new field customer item references [End]
//Changed by Sneha on 24-10-2016, to add new field customer item references [End]
if(barcodeFlagVal.equalsIgnoreCase("Y"))
{
String barcodeAutoStr = generateTranId( "w_barcode",loginSiteCode,conn);
System.out.println("barcodeAutoStr===========>>"+barcodeAutoStr);
valueXmlString.append("<item_barcode>").append("<![CDATA["+ checkNullAndTrim(barcodeAutoStr) +"]]>").append("</item_barcode>\r\n");
}
else if(barcodeFlagVal.equalsIgnoreCase("N"))
{
valueXmlString.append("<item_barcode>").append("<![CDATA[]]>").append("</item_barcode>\r\n");
}
}
valueXmlString.append("</Detail2>\r\n");
......@@ -1685,7 +1721,6 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
{
conn = getConnection();
custItemRefVal = checkNullAndTrim(discommon.getDisparams("999999", "CUST_ITEM_REF", conn));
System.out.println("custItemRefVal=========>>"+custItemRefVal);
}
catch (Exception e)
......@@ -1709,12 +1744,235 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
throw new ITMException(e);
}
}
System.out.println("custItemRefVal=========>>"+custItemRefVal);
System.out.println("Return Value for disparm for CUST_ITEM_REF =========>>"+custItemRefVal);
return custItemRefVal;
}
//Changed by Sneha on 24-10-2016, for field customer item references, disparm value [End]
// Changed by Sneha on 23-11-2016, to default values flag [Start]
public String defaultValueFlag() throws RemoteException, ITMException
{
Connection conn = null;
String val = "";
try
{
conn = getConnection();
val = checkNullAndTrim(discommon.getDisparams("999999", "PRODUCT_DEFAULT_VALUES", conn));
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("Exception : getDefaultValuesFlagVal():" + e.getMessage() + ":");
}
finally
{
try
{
if (conn != null && !conn.isClosed())
{
conn.close();
conn = null;
}
}
catch (Exception e)
{
System.out.println("Exception :defaultValueFlag(String) :==>\n"+ e.getMessage());
throw new ITMException(e);
}
}
System.out.println("Return Value for disparm for PRODUCT_DEFAULT_VALUES =========>>"+val);
return val;
}
public JSONObject getDefaultValuesfromJSON() throws RemoteException, ITMException
{
JSONArray jsonArray = new JSONArray();
JSONObject jsonObject = new JSONObject();
JSONParser jsonParser = new JSONParser();
int count = 1;
String jsonFileName = "";
try
{
System.out.println("CommonConstants.APPLICATION_CONTEXT-->>["+CommonConstants.APPLICATION_CONTEXT+"]");
System.out.println("CommonConstants.JBOSSHOME-->>["+CommonConstants.JBOSSHOME+"]");
if(CommonConstants.APPLICATION_CONTEXT != null)
{
jsonFileName = CommonConstants.APPLICATION_CONTEXT + "setting" + File.separator + "productWizDefault.json";
}
else
{
jsonFileName = CommonConstants.JBOSSHOME + File.separator + "server" + File.separator + "default" + File.separator + "deploy" + File.separator + "ibase.ear" + File.separator + "ibase.war" + File.separator +"setting" + File.separator +"productWizDefault.json";
}
System.out.print("jsonFileName path ========>>"+jsonFileName);
jsonArray = (JSONArray) jsonParser.parse(new FileReader(jsonFileName));
//System.out.print("jsonArray---->>"+jsonArray);
for (Object obj : jsonArray)
{
JSONObject tempJson = (JSONObject) obj;
//System.out.print("tempJson JSONObject ---->> " + tempJson);
jsonObject.put(count, tempJson);
count++;
}
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
catch (ParseException e)
{
e.printStackTrace();
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("Exception : getDefaultValuesfromJSON():" + e.getMessage() + ":");
}
System.out.println("Return Value for getDefaultValuesfromJSON =========>>"+jsonObject);
return jsonObject;
}
public String getDefaultBarcodeFlagVal() throws RemoteException, ITMException
{
Connection conn = null;
String returnVal = "";
try
{
conn = getConnection();
returnVal = checkNullAndTrim(discommon.getDisparams("999999", "PRODWIZ_AUTOBARCODE", conn));
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("Exception : getDefaultBarcodeFlagVal():" + e.getMessage() + ":");
}
finally
{
try
{
if (conn != null && !conn.isClosed())
{
conn.close();
conn = null;
}
}
catch (Exception e)
{
System.out.println("Exception :getDefaultBarcodeFlagVal(String) :==>\n"+ e.getMessage());
throw new ITMException(e);
}
}
System.out.println("Return Value for disparm for PRODWIZ_AUTOBARCODE =========>>"+returnVal);
return returnVal;
}
public String generateTranId( String windowName, String siteCode, Connection conn )throws ITMException
{
PreparedStatement pstmt = null;
ResultSet rs = null;
String selSql = "";
String tranId = "";
String tranSer = "";
String keyString = "";
String keyCol = "";
String xmlValues = "";
String paySiteCode = "";
String effectiveDate = "";
java.sql.Timestamp currDate = null;
java.sql.Date effDate = null;
E12GenericUtility genericUtility = new E12GenericUtility();
try
{
if(conn == null)
{
conn = getConnection();
}
SimpleDateFormat sdfAppl = new SimpleDateFormat(genericUtility.getApplDateFormat());
currDate = new java.sql.Timestamp(System.currentTimeMillis());
String currDateStr = sdfAppl.format(currDate);
selSql = "SELECT KEY_STRING, TRAN_ID_COL, REF_SER FROM TRANSETUP WHERE TRAN_WINDOW = ? ";
pstmt = conn.prepareStatement(selSql);
pstmt.setString( 1, windowName );
rs = pstmt.executeQuery();
if (rs.next())
{
keyString = rs.getString("KEY_STRING");
keyCol = rs.getString("TRAN_ID_COL");
tranSer = rs.getString("REF_SER");
}
rs.close();rs = null;
pstmt.close();pstmt = null;
System.out.println("keyString :"+keyString);
System.out.println("keyCol :"+keyCol);
System.out.println("tranSer :"+tranSer);
xmlValues ="<?xml version=\"1.0\" encoding=\"utf-8\"?><Root>";
xmlValues = xmlValues + "<Header></Header>";
xmlValues = xmlValues + "<Detail1>";
xmlValues = xmlValues + "<tran_id></tran_id>";
xmlValues = xmlValues + "<site_code>" + siteCode + "</site_code>";
xmlValues = xmlValues + "<tran_date>" + currDateStr + "</tran_date>";
xmlValues = xmlValues + "</Detail1></Root>";
System.out.println("xmlValues :["+xmlValues+"]");
TransIDGenerator tg = new TransIDGenerator(xmlValues, "BASE", CommonConstants.DB_NAME);
tranId = tg.generateTranSeqID(tranSer, keyCol, keyString, conn);
System.out.println("tranId :"+tranId);
}
catch (SQLException ex)
{
System.out.println("Exception ::" +selSql+ ex.getMessage() + ":");
ex.printStackTrace();
throw new ITMException(ex);
}
catch (Exception e)
{
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (conn != null && !conn.isClosed())
{
conn.close();
conn = null;
}
}
catch(Exception e){}
}
return checkNullAndTrim(tranId);
}
// Changed by Sneha on 23-11-2016, to default values flag [End]
/**
*
......@@ -1747,4 +2005,5 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
return "N";
}
}
......@@ -965,7 +965,7 @@ public class DDProductWizEditPosEJB extends ValidatorEJB implements DDProductWiz
sql = "UPDATE ITEM SET DESCR = ?, ITEM_SER = ?, GRP_CODE = ?, ITEM_TYPE = ?, LOC_TYPE = ?, "
+ " LOC_CODE = ?, LENGTH = ?, WIDTH = ?, HEIGHT = ?, GROSS_WEIGHT = ?, PHY_ATTRIB_1 = ?, PHY_ATTRIB_2 = ?, "
+ " PHY_ATTRIB_3 = ?, PHY_ATTRIB_23 = ?, UDF__STR2 = ?, LOC_TYPE__PARENT = ?, "
+ " PUR_LEAD_TIME = ?, UDF__STR1 = ?, CHG_DATE = SYSDATE, CHG_TERM = ?, CHG_USER = ?, HSN_NO = ?"
+ " PUR_LEAD_TIME = ?, UDF__STR1 = ?, CHG_DATE = SYSDATE, CHG_TERM = ?, CHG_USER = ?, HSN_NO = ? "
+ " ,PHY_ATTRIB_24 = ?, USAGE_TYPE = ?, CATALOG_NO = ? " //Changed by samadhan on 23/12/2015 for brand, limited edition,stop purchase
+ " ,TAX_CHAP = ? " //Changed by wasim on 02/08/2016 for tax chap for child items
+ " ,TRADE_MARK = ? " //Changed By Sneha on 27-09-2016 for adding trade mark for child item
......@@ -1665,7 +1665,8 @@ public class DDProductWizEditPosEJB extends ValidatorEJB implements DDProductWiz
siteCode = rs.getString(1);
String sqlSiteIns = "INSERT INTO SITEITEM (SITE_CODE, ITEM_CODE, MIN_QTY, MAX_QTY, REO_QTY, REO_LEV, "
+ " PUR_LEAD_TIME, STK_OPT, ITEM_SER, ACTIVE, CHG_DATE, CHG_USER, CHG_TERM , LOC_CODE__APRV)"
+ " PUR_LEAD_TIME, STK_OPT, ITEM_SER, ACTIVE, CHG_DATE, CHG_USER, CHG_TERM , LOC_CODE__APRV, "
+ " SUPP_SOUR ) " // Added by Sneha on 21-11-2016
+ " VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?) ";
if (siteList.contains(siteCode.trim()))
......@@ -1692,7 +1693,8 @@ public class DDProductWizEditPosEJB extends ValidatorEJB implements DDProductWiz
pstmtIns.setString(12, userId);
pstmtIns.setString(13, chgTerm);
pstmtIns.setString(14, loc_code);
pstmtIns.setString(15, "P"); // Change by Sneha on date 21-11-2013
pstmtIns.executeUpdate();
pstmtIns.close();
pstmtIns = null;
......
......@@ -4,9 +4,12 @@ import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import javax.ejb.Local;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.w3c.dom.Document;
@Local
......@@ -22,4 +25,14 @@ public interface DDProductWizLocal extends ValidatorLocal
public String getList(String loginCode, String field, String[] values) throws RemoteException,ITMException;
public String getCustItemRefFlagVal() throws RemoteException, ITMException;
public String defaultValueFlag() throws RemoteException, ITMException;
public JSONObject getDefaultValuesfromJSON() throws RemoteException, ITMException;
public String getDefaultBarcodeFlagVal() throws ITMException, RemoteException;
public String generateTranId( String windowName, String siteCode, Connection conn )throws ITMException;
}
......@@ -1244,8 +1244,9 @@ public class DDProductWizPosEJB extends ValidatorEJB implements DDProductWizPosR
siteCode = rs1.getString(1);
String sqlSiteIns = "insert into SITEITEM (SITE_CODE, ITEM_CODE, MIN_QTY, MAX_QTY, REO_QTY, REO_LEV, "
+ " PUR_LEAD_TIME, STK_OPT, ITEM_SER, ACTIVE, CHG_DATE, CHG_USER, CHG_TERM , loc_code__aprv)"
+ " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
+ " PUR_LEAD_TIME, STK_OPT, ITEM_SER, ACTIVE, CHG_DATE, CHG_USER, CHG_TERM , loc_code__aprv, "
+ " SUPP_SOUR ) " // Added by Sneha on 21-11-2016
+ " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
pstmtIns = conn.prepareStatement(sqlSiteIns);
......@@ -1411,6 +1412,7 @@ public class DDProductWizPosEJB extends ValidatorEJB implements DDProductWizPosR
pstmtIns.setString(12, chg_user);
pstmtIns.setString(13, chg_term);
pstmtIns.setString(14, loc_code); // Change by Parikshit Kumbhar on date 18/05/2015
pstmtIns.setString(15, "P"); // Change by Sneha on date 21-11-2013
pstmtIns.executeUpdate();
pstmtIns.close();
......
......@@ -4,9 +4,12 @@ import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import javax.ejb.Remote;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.w3c.dom.Document;
@Remote
......@@ -22,5 +25,14 @@ public interface DDProductWizRemote extends ValidatorRemote
public String getList(String loginCode, String field, String[] values) throws RemoteException,ITMException;
public String getCustItemRefFlagVal() throws RemoteException, ITMException;
public String defaultValueFlag() throws RemoteException, ITMException;
public JSONObject getDefaultValuesfromJSON() throws RemoteException, ITMException;
public String getDefaultBarcodeFlagVal() throws ITMException, RemoteException;
public String generateTranId( String windowName, String siteCode, Connection conn )throws ITMException;
}
......@@ -13,6 +13,8 @@ import ibase.webitm.ejb.wms.DDPorderWizPosEJBRemote;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.TransIDGenerator;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.OutputStream;
import java.io.StringReader;
......@@ -37,11 +39,16 @@ import javax.servlet.http.HttpSession;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
public class ProdWizItemChangeServlet extends HttpServlet
{
private static final long serialVersionUID = 1L;
......@@ -173,12 +180,27 @@ public class ProdWizItemChangeServlet extends HttpServlet
}
// Changed by Sneha on 25-10-2016, for customer item reference flag [Start]
if ( action.equalsIgnoreCase( "CUST_ITEM_REF" ) )
else if ( action.equalsIgnoreCase( "CUST_ITEM_REF" ) )
{
retStr = itemDetailsBean.getCustItemRefFlag();
}
// Changed by Sneha on 25-10-2016, for customer item reference flag [End]
// Changed by Sneha on 23-11-2016, to default values flag and autogenerate barcode flag [Start]
else if ( action.equalsIgnoreCase( "SET_DEFAULT_VALUES" ))
{
retStr = itemDetailsBean.getDefaultValuesFlag();
}
else if ( action.equalsIgnoreCase( "SET_DEFAULT_BARCODE_FLAG" ))
{
retStr = itemDetailsBean.getDefaultBarcodeFlag();
}
else if ( action.equalsIgnoreCase( "GET_DEFAULT_BARCODE_VAL" ))
{
retStr = itemDetailsBean.defaultBarcodeVal(userId);
}
// Changed by Sneha on 23-11-2016, to default values flag and autogenerate barcode flag [End]
// Changed by Sneha on 07-04-2016, for item description [Start]
else if(action.equalsIgnoreCase( "GET_ITEM_DESCR" ))
{
......
/**
* Purpose: Servlet for default Values,
* Author: Sneha Mestry
* Date: 23-11-2016
*/
package ibase.webitm.servlet.wms;
import ibase.system.config.AppConnectParm;
import ibase.webitm.utility.ITMException;
import java.io.IOException;
import java.io.OutputStream;
import javax.naming.InitialContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import ibase.webitm.ejb.wms.DDProductWizRemote;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
public class ProdtWizDefaultValuesServlet extends HttpServlet
{
private static final long serialVersionUID = 1L;
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
doPost(request, response);
}
@SuppressWarnings("unchecked")
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
System.out.println("XXXXXXXXXXXXXXXXXXXXXX[ ProdtWizDefaultValuesServlet ]XXXXXXXXXXXXXXXXXXXX");
try
{
response.setContentType("application/xml");
HttpSession session = request.getSession(true);
String action = request.getParameter("ACTION");
System.out.println("ACTION from request ====>> ["+action+"]");
DDProductWizRemote ddProductWizRemote = null;
JSONObject jsonObjData = new JSONObject();
if ( action.equalsIgnoreCase("GET_DEFAULT_VALUES"))
{
InitialContext ctx = new InitialContext(new AppConnectParm().getProperty());
ddProductWizRemote = (DDProductWizRemote) ctx.lookup("ibase/DDProductWizEJB/remote");
jsonObjData = (JSONObject)ddProductWizRemote.getDefaultValuesfromJSON();
}
OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush();
outputStream.close();
System.out.println(" Final value form ProdtWizDefaultValuesServlet ===>>" + jsonObjData);
}
catch (Exception e)
{
System.out.println("Exception in: ProdtWizDefaultValuesServlet :doPost(HttpServletRequest request, HttpServletResponse response) :" + e.getMessage());
try
{
throw new ITMException(e);
} catch (ITMException e1)
{
e1.printStackTrace();
}
}
}
}
\ No newline at end of file
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