Commit f37f6d9a authored by smestry's avatar smestry

Updated the java file for product wizard


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@103955 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 33e1fb8b
......@@ -434,7 +434,7 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
else if (childNodeName.equalsIgnoreCase("phy_attrib_4"))
{
String custItemRef = checkNullAndTrim(genericUtility.getColumnValue("phy_attrib_4", dom));
//System.out.println("dimensionDesc==========>>"+dimensionDesc);
System.out.println("custItemRef==========>>"+custItemRef);
if (custItemRef.length() == 0)
{
......@@ -442,15 +442,47 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
int count = 0;
String countSerSql = "SELECT COUNT(1) AS COUNT FROM ITEM WHERE TRIM(PHY_ATTRIB_4) = ?";
PreparedStatement pstmtParamName = conn.prepareStatement(countSerSql);
pstmtParamName.setString(1, custItemRef);
ResultSet rsCnt = pstmtParamName.executeQuery();
if (rsCnt.next())
{
count = rsCnt.getInt("COUNT");
}
if( pstmtParamName != null )
{
pstmtParamName.close();
pstmtParamName = null;
}
if ( rsCnt != null )
{
rsCnt.close();
rsCnt = null;
}
if (count > 0)
{
errCode = "DUPCUSTITM";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
// Changed by Sneha on 24-10-2016 for validation of customer item reference [End]
}
break;
case 2 :
String customerName = "", phy_attrib_4 = "";
String customerName = "", custItemRef = "";
int paramName = 0;
System.out.println("DOM in case2 ---->>["+genericUtility.serializeDom(dom).toString()+"]");
System.out.println("DOM1 in case2 ----->>["+genericUtility.serializeDom(dom1).toString()+"]");
System.out.println("DOM2 in case2 ----->>["+genericUtility.serializeDom(dom2).toString()+"]");
parentNodeList = dom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
......@@ -514,11 +546,19 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
// Changed by Sneha on 23-06-2016 for duplicate validation for customer item references [Start]
else if (childNodeName.equalsIgnoreCase("phy_attrib_4"))
{
phy_attrib_4 = genericUtility.getColumnValue("phy_attrib_4", dom);
custItemRef = genericUtility.getColumnValue("phy_attrib_4", dom);
if (custItemRef.length() == 0)
{
errCode = "VTINVCITEM";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if (custItemRef.length() > 0)
{
String countSerSql = "SELECT COUNT(1) AS COUNT FROM ITEM WHERE TRIM(PHY_ATTRIB_4) = ?";
PreparedStatement pstmtParamName = conn.prepareStatement(countSerSql);
pstmtParamName.setString(1, phy_attrib_4);
pstmtParamName.setString(1, custItemRef);
ResultSet rsCnt = pstmtParamName.executeQuery();
if (rsCnt.next())
{
......@@ -537,16 +577,20 @@ public class DDProductWizEJB extends ValidatorEJB implements DDProductWizRemote,
if (paramName != 0)
{
flag = true;
fieldValue = phy_attrib_4;
fieldValue = custItemRef;
msgNo = "DUPCUSTITM";
msgStr1 = "Invalid Customer item reference for.";
msgStr2 = "Customer item reference already exists in item master";
}
}
// Changed by Sneha on 23-06-2016 for duplicate validation for customer item references [End]
}
}
// Changed by Sneha on 23-06-2016 for duplicate validation for customer item references [End]
}
if( errString.indexOf("<Errors>")!=-1 )
{
if( errString.length() > 0 )
......
......@@ -229,6 +229,68 @@ public class DDProductWizEditEJB extends ValidatorEJB implements DDProductWizEdi
}
break;
case 2 :
{
System.out.println(" -------- Inside wfValData case 2 ----------- ");
String phy_attrib_4 = "";
int paramName = 0;
parentNodeList = dom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeListLength; ctr ++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if (childNodeName.equalsIgnoreCase("phy_attrib_4"))
{
phy_attrib_4 = genericUtility.getColumnValue("phy_attrib_4", dom);
String ITEM_CODE = genericUtility.getColumnValue("item_code", dom);
if (phy_attrib_4.length() == 0)
{
errCode = "VTINVCITEM";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if (phy_attrib_4.length() > 0)
{
String countSerSql = "SELECT COUNT(1) AS COUNT FROM ITEM WHERE TRIM(PHY_ATTRIB_4) = ? AND ITEM_PARNT != ? ";
PreparedStatement pstmtParamName = conn.prepareStatement(countSerSql);
pstmtParamName.setString(1, phy_attrib_4);
pstmtParamName.setString(2, ITEM_CODE);
ResultSet rsCnt = pstmtParamName.executeQuery();
if (rsCnt.next())
{
paramName = rsCnt.getInt("COUNT");
}
if( pstmtParamName != null )
{
pstmtParamName.close();
pstmtParamName = null;
}
if ( rsCnt != null )
{
rsCnt.close();
rsCnt = null;
}
if (paramName != 0)
{
flag = true;
fieldValue = phy_attrib_4;
msgNo = "DUPCUSTITM";
msgStr1 = "Invalid Customer item reference for.";
msgStr2 = "Customer item reference already exists in item master";
}
}
}
}
}
break;
case 3 :
System.out.println(" -------- Inside wfValData case 3 ----------- ");
String customerName = "", phy_attrib_4 = "";
......@@ -247,11 +309,10 @@ public class DDProductWizEditEJB extends ValidatorEJB implements DDProductWizEdi
if (childNodeName.equalsIgnoreCase("item_barcode"))
{
item_barcode = genericUtility.getColumnValue("item_barcode", dom);
String ITEM_CODE = genericUtility.getColumnValue("item_code", dom);
String countSerSql = "SELECT COUNT(1) AS COUNT FROM ITEM WHERE TRIM(udf__str2) = ? AND item_code != ? ";
String countSerSql = "SELECT COUNT(1) AS COUNT FROM ITEM WHERE TRIM(UDF__STR2) = ? AND ITEM_CODE != ? ";
PreparedStatement pstmtParamName = conn.prepareStatement(countSerSql);
pstmtParamName.setString(1, item_barcode);
pstmtParamName.setString(2, ITEM_CODE);
......@@ -297,6 +358,14 @@ public class DDProductWizEditEJB extends ValidatorEJB implements DDProductWizEdi
phy_attrib_4 = genericUtility.getColumnValue("phy_attrib_4", dom);
String ITEM_CODE = genericUtility.getColumnValue("item_code", dom);
if (phy_attrib_4.length() == 0)
{
errCode = "VTINVCITEM";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if (phy_attrib_4.length() > 0)
{
String countSerSql = "SELECT COUNT(1) AS COUNT FROM ITEM WHERE TRIM(PHY_ATTRIB_4) = ? AND ITEM_CODE != ? ";
PreparedStatement pstmtParamName = conn.prepareStatement(countSerSql);
pstmtParamName.setString(1, phy_attrib_4);
......@@ -325,6 +394,7 @@ public class DDProductWizEditEJB extends ValidatorEJB implements DDProductWizEdi
msgStr2 = "Customer item reference already exists in item master";
}
}
}
// Changed by Sneha on 23-06-2016 for duplicate validation for customer item references [End]
}
//Added by Parikshit Kumbhar on 25/06/2015 to make error msg on barcode End
......@@ -544,17 +614,19 @@ public class DDProductWizEditEJB extends ValidatorEJB implements DDProductWizEdi
case 3:
{
System.out.println("---------- Inside itemChanged Case3 --------- ");
System.out.println("DOM in case3 ---->>["+genericUtility.serializeDom(dom).toString()+"]");
/* System.out.println("DOM in case3 ---->>["+genericUtility.serializeDom(dom).toString()+"]");
System.out.println("DOM1 in case3 ----->>["+genericUtility.serializeDom(dom1).toString()+"]");
System.out.println("DOM2 in case3 ----->>["+genericUtility.serializeDom(dom2).toString()+"]");
*/
String itemCode = genericUtility.getColumnValue("item_code", dom1);
String phy_attrib_4 = genericUtility.getColumnValue("phy_attrib_4", dom2);
//System.out.println("phy_attrib_4 in case 3 ======>>"+phy_attrib_4);
if( currentColumn.trim().equalsIgnoreCase( "itm_default" ))
{
//Changed by Sneha on 30-03-2016, for login code [Start]
//valueXmlString.append( getSKUDetails( dom, itemCode, dom1, dom2) );
valueXmlString.append( getSKUDetails( dom, dom1, dom2, itemCode, userId) );
valueXmlString.append( getSKUDetails( dom, dom1, dom2, itemCode, phy_attrib_4, userId) );
//Changed by Sneha on 30-03-2016, for login code [End]
}
System.out.println("valueXmlString in case 3 ======>>"+valueXmlString.toString());
......@@ -900,7 +972,7 @@ public class DDProductWizEditEJB extends ValidatorEJB implements DDProductWizEdi
// Changed by Sneha on 30-03-2016, for login code [Start]
//private String getSKUDetails( Document dom, String itemCode, Document dom1, Document dom2, String userId) throws Exception
private String getSKUDetails( Document dom, Document dom1, Document dom2, String itemCode, String userId) throws Exception
private String getSKUDetails( Document dom, Document dom1, Document dom2, String itemCode, String phy_attrib_4, String userId) throws Exception
// Changed by Sneha on 30-03-2016, for login code [End]
{
PreparedStatement pstmt = null ;
......@@ -953,7 +1025,7 @@ public class DDProductWizEditEJB extends ValidatorEJB implements DDProductWizEdi
valueXmlString.append("<login_code>").append("<![CDATA["+ userId +"]]>").append("</login_code>\r\n");
valueXmlString.append("<item_parent>").append("<![CDATA["+ itemCode +"]]>").append("</item_parent>\r\n");
// Changed by Sneha on 01-04-2016, for login code [End]
valueXmlString.append("<phy_attrib_4>").append("<![CDATA["+ phy_attrib_4 +"]]>").append("</phy_attrib_4>\r\n");
valueXmlString.append("<supp_code>").append("<![CDATA["+ checkNullAndTrim(suppCodes) +"]]>").append("</supp_code>\r\n");
valueXmlString.append("<supp_descr>").append("<![CDATA["+ checkNullAndTrim(suppdtls) +"]]>").append("</supp_descr>\r\n");
//Added by parikshit on 07/07/15 [for check null value] end
......
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