Commit 9ec7e979 authored by mchauhan's avatar mchauhan

Added validation not to allow same stock in multiple line of dist issue.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@214453 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bb7c98ca
......@@ -2311,7 +2311,13 @@ public class DistIssueIC extends ValidatorEJB {
NodeList childNodeList = null;
Node parentNode = null;
Node parentNodeTemp = null;
Node childNode = null;
Node childNode = null;//Added By Mukesh Chauhan on 02/01/2020 START
NodeList detail2List = null;
NodeList childDetilList=null;
Node detailNode = null;
Node chidDetailNode= null;
String itemCodeDet="" ,locCodeDet="",lotSlDet="",lotNoDet="",updateFlag = "";
int lineNoCur=0,lineValueInt=0;//Added By Mukesh Chauhan on 02/01/2020 END
String siteCode = "";
String userId = "";
String sql="";
......@@ -3268,8 +3274,15 @@ public class DistIssueIC extends ValidatorEJB {
}
}
}// end of if block
else if("lot_no".equalsIgnoreCase(childNodeName))
else if("lot_no".equalsIgnoreCase(childNodeName))//Changed by Mukesh Chauhan on 28/12/19 START
{
lineNo = checkNull(genericUtility.getColumnValue("line_no", dom));//Added By Mukesh Chauhan on 02/01/2020 START
itemCode = checkNullAndTrim(genericUtility.getColumnValue("item_code", dom));
locCode = checkNullAndTrim(genericUtility.getColumnValue("loc_code", dom));
lotSl = checkNullAndTrim(genericUtility.getColumnValue("lot_sl", dom));
lotNo = checkNullAndTrim(genericUtility.getColumnValue("lot_no", dom));
detail2List = dom2.getElementsByTagName("Detail2");//Added By Mukesh Chauhan on 02/01/2020 END
lotNo = checkNullAndTrim(genericUtility.getColumnValue("lot_no", dom));
if (lotNo == null || lotNo.trim().length() == 0)
{
......@@ -3277,7 +3290,87 @@ public class DistIssueIC extends ValidatorEJB {
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(lineNo!=null && lineNo.trim().length()>0) //Added By Mukesh Chauhan on 02/01/2020 for not to allow duplicate stock START
{
lineNoCur=Integer.parseInt(lineNo.trim());
}
for(int selectAll = 0; selectAll < detail2List.getLength(); selectAll++) {
detailNode = detail2List.item(selectAll);
childDetilList = detailNode.getChildNodes();
for (int childDet = 0; childDet < childDetilList.getLength(); childDet++)
{
chidDetailNode = childDetilList.item(childDet);
System.out.println("current child node>>>>>>>>>> " + chidDetailNode.getNodeName());
if (chidDetailNode.getNodeName().equalsIgnoreCase("line_no"))
{
System.out.println("line node found >>>>>" + chidDetailNode.getNodeName());
if (chidDetailNode.getFirstChild() != null)
{
String lineValue = chidDetailNode.getFirstChild().getNodeValue();
if (lineValue != null && lineValue.trim().length() > 0)
{
lineValueInt = Integer.parseInt(lineValue.trim());
}
}
}
if (chidDetailNode.getNodeName().equalsIgnoreCase("attribute"))
{
System.out.println("operation node found >>>>>" + chidDetailNode.getNodeName());
updateFlag = chidDetailNode.getAttributes().getNamedItem("updateFlag")
.getNodeValue();
}
if (chidDetailNode.getNodeName().equalsIgnoreCase("item_code"))
{
if (chidDetailNode.getFirstChild() != null)
{
itemCodeDet =checkNullAndTrim(chidDetailNode.getFirstChild().getNodeValue());
}
}
if (chidDetailNode.getNodeName().equalsIgnoreCase("loc_code"))
{
if (chidDetailNode.getFirstChild() != null)
{
locCodeDet = checkNullAndTrim(chidDetailNode.getFirstChild().getNodeValue());
}
}
if (chidDetailNode.getNodeName().equalsIgnoreCase("lot_sl"))
{
if (chidDetailNode.getFirstChild() != null)
{
lotSlDet = checkNullAndTrim(chidDetailNode.getFirstChild().getNodeValue());
if (lineNoCur != lineValueInt && !updateFlag.equalsIgnoreCase("D") && itemCodeDet.equalsIgnoreCase(itemCode)
&& locCodeDet.equalsIgnoreCase(locCode) && lotSlDet.equalsIgnoreCase(lotSl) && lotNoDet.equalsIgnoreCase(lotNo))
{
errCode = "VTDUPSTOCK ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
if (chidDetailNode.getNodeName().equalsIgnoreCase("lot_no"))
{
if (chidDetailNode.getFirstChild() != null)
{
lotNoDet = checkNullAndTrim(chidDetailNode.getFirstChild().getNodeValue());
}
}
}//Added By Mukesh Chauhan on 02/01/2020 END
}
}// end of if block
//Changed by Mukesh Chauhan on 28/12/19 END
else if("site_code__mfg".equalsIgnoreCase(childNodeName))
{
siteCodeMfg = checkNullAndTrim(genericUtility.getColumnValue("site_code__mfg", dom));
......
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